CorePlugin: Remove foreach / Q_FOREACH usage mostly in dialogs

Task-number: QTCREATORBUG-27464
Change-Id: Iad47e9cb0b2fa7590dba2d26d0a33a83d2909bb7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Artem Sokolovskii
2022-05-02 17:25:11 +02:00
parent 33a385c4d6
commit f4e943bda3
15 changed files with 73 additions and 57 deletions

View File

@@ -270,18 +270,18 @@ bool IOptionsPage::matches(const QRegularExpression &regexp) const
if (!widget)
return false;
// find common subwidgets
foreach (const QLabel *label, widget->findChildren<QLabel *>())
for (const QLabel *label : widget->findChildren<QLabel *>())
m_keywords << Utils::stripAccelerator(label->text());
foreach (const QCheckBox *checkbox, widget->findChildren<QCheckBox *>())
for (const QCheckBox *checkbox : widget->findChildren<QCheckBox *>())
m_keywords << Utils::stripAccelerator(checkbox->text());
foreach (const QPushButton *pushButton, widget->findChildren<QPushButton *>())
for (const QPushButton *pushButton : widget->findChildren<QPushButton *>())
m_keywords << Utils::stripAccelerator(pushButton->text());
foreach (const QGroupBox *groupBox, widget->findChildren<QGroupBox *>())
for (const QGroupBox *groupBox : widget->findChildren<QGroupBox *>())
m_keywords << Utils::stripAccelerator(groupBox->title());
m_keywordsInitialized = true;
}
foreach (const QString &keyword, m_keywords)
for (const QString &keyword : qAsConst(m_keywords))
if (keyword.contains(regexp))
return true;
return false;