Changeset View
Changeset View
Standalone View
Standalone View
kcms/keys/export_scheme_dialog.cpp
Show All 37 Lines | 33 | { | |||
---|---|---|---|---|---|
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 | { | 47 | { | ||
48 | QCheckBox *cb = new QCheckBox(component); | 48 | QCheckBox *cb = new QCheckBox(component); | ||
49 | vb->addWidget(cb, item / 2, item % 2); | 49 | vb->addWidget(cb, item / 2, item % 2); | ||
50 | mButtons.addButton(cb, item); | 50 | mButtons.addButton(cb, item); | ||
51 | ++item; | 51 | ++item; | ||
52 | } | 52 | } | ||
53 | 53 | | |||
54 | ui.components->setLayout(vb); | 54 | ui.components->setLayout(vb); | ||
Show All 10 Lines | |||||
65 | 65 | | |||
66 | ExportSchemeDialog::~ExportSchemeDialog() | 66 | ExportSchemeDialog::~ExportSchemeDialog() | ||
67 | {} | 67 | {} | ||
68 | 68 | | |||
69 | 69 | | |||
70 | QStringList ExportSchemeDialog::selectedComponents() const | 70 | QStringList ExportSchemeDialog::selectedComponents() const | ||
71 | { | 71 | { | ||
72 | QStringList rc; | 72 | QStringList rc; | ||
73 | Q_FOREACH(QAbstractButton const *button, mButtons.buttons()) | 73 | const auto buttons = mButtons.buttons(); | ||
74 | for (const QAbstractButton *button : buttons) | ||||
ahmadsamir: const QAbstractButton *button | |||||
bport: { on same line | |||||
74 | { | 75 | { | ||
75 | if (button->isChecked()) | 76 | if (button->isChecked()) | ||
76 | { | 77 | { | ||
77 | // Remove the '&' added by KAcceleratorManager magically | 78 | // Remove the '&' added by KAcceleratorManager magically | ||
78 | rc.append(KLocalizedString::removeAcceleratorMarker(button->text())); | 79 | rc.append(KLocalizedString::removeAcceleratorMarker(button->text())); | ||
79 | } | 80 | } | ||
80 | } | 81 | } | ||
81 | return rc; | 82 | return rc; | ||
82 | } | 83 | } | ||
83 | 84 | | |||
84 | 85 | | |||
85 | #include "moc_export_scheme_dialog.cpp" | 86 | #include "moc_export_scheme_dialog.cpp" |
const QString &