Changeset View
Changeset View
Standalone View
Standalone View
kcms/keys/export_scheme_dialog.cpp
Show All 36 Lines | 33 | { | |||
---|---|---|---|---|---|
37 | mainLayout->addWidget(w); | 37 | mainLayout->addWidget(w); | ||
38 | 38 | | |||
39 | // We allow to check more than one button | 39 | // We allow to check more than one button | ||
40 | mButtons.setExclusive(false); | 40 | mButtons.setExclusive(false); | ||
41 | 41 | | |||
42 | // A grid layout for the buttons | 42 | // A grid layout for the buttons | ||
43 | QGridLayout *vb = new QGridLayout(this); | 43 | QGridLayout *vb = new QGridLayout(this); | ||
44 | 44 | | |||
45 | int item=0; | 45 | int item=0; | ||
46 | Q_FOREACH(QString component, mComponents) | 46 | for (const QString &component : qAsConst(mComponents)) { | ||
ahmadsamir: const QString & | |||||
bport: { on same line | |||||
47 | { | | |||
48 | QCheckBox *cb = new QCheckBox(component); | 47 | QCheckBox *cb = new QCheckBox(component); | ||
49 | vb->addWidget(cb, item / 2, item % 2); | 48 | vb->addWidget(cb, item / 2, item % 2); | ||
50 | mButtons.addButton(cb, item); | 49 | mButtons.addButton(cb, item); | ||
51 | ++item; | 50 | ++item; | ||
52 | } | 51 | } | ||
53 | 52 | | |||
54 | ui.components->setLayout(vb); | 53 | ui.components->setLayout(vb); | ||
55 | 54 | | |||
Show All 9 Lines | |||||
65 | 64 | | |||
66 | ExportSchemeDialog::~ExportSchemeDialog() | 65 | ExportSchemeDialog::~ExportSchemeDialog() | ||
67 | {} | 66 | {} | ||
68 | 67 | | |||
69 | 68 | | |||
70 | QStringList ExportSchemeDialog::selectedComponents() const | 69 | QStringList ExportSchemeDialog::selectedComponents() const | ||
71 | { | 70 | { | ||
72 | QStringList rc; | 71 | QStringList rc; | ||
73 | Q_FOREACH(QAbstractButton const *button, mButtons.buttons()) | 72 | const auto buttons = mButtons.buttons(); | ||
ahmadsamir: const QAbstractButton *button | |||||
bport: { on same line | |||||
74 | { | 73 | for (const QAbstractButton *button : buttons) { | ||
75 | if (button->isChecked()) | 74 | if (button->isChecked()) | ||
76 | { | 75 | { | ||
77 | // Remove the '&' added by KAcceleratorManager magically | 76 | // Remove the '&' added by KAcceleratorManager magically | ||
78 | rc.append(KLocalizedString::removeAcceleratorMarker(button->text())); | 77 | rc.append(KLocalizedString::removeAcceleratorMarker(button->text())); | ||
79 | } | 78 | } | ||
80 | } | 79 | } | ||
81 | return rc; | 80 | return rc; | ||
82 | } | 81 | } | ||
83 | 82 | | |||
84 | 83 | | |||
85 | #include "moc_export_scheme_dialog.cpp" | 84 | #include "moc_export_scheme_dialog.cpp" |
const QString &