MCPcopy Create free account
hub / github.com/YACReader/yacreader / selectInCombo

Function selectInCombo

common/themes/appearance_tab_widget.cpp:19–27  ·  view source on GitHub ↗

Select the item in combo whose UserRole data matches id (no-op if not found).

Source from the content-addressed store, hash-verified

17
18// Select the item in combo whose UserRole data matches id (no-op if not found).
19static void selectInCombo(QComboBox *combo, const QString &id)
20{
21 for (int i = 0; i < combo->count(); ++i) {
22 if (combo->itemData(i).toString() == id) {
23 combo->setCurrentIndex(i);
24 return;
25 }
26 }
27}
28
29AppearanceTabWidget::AppearanceTabWidget(
30 AppearanceConfiguration *config,

Callers 2

AppearanceTabWidgetMethod · 0.85
importThemeMethod · 0.85

Calls 2

toStringMethod · 0.80
setCurrentIndexMethod · 0.45

Tested by

no test coverage detected