diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-08-05 11:13:11 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-08-07 21:56:10 +0000 |
commit | ddcf716762e5100f56e23b4171f225ed1a97709c (patch) | |
tree | 23aa27791587787e2af8e42f300d8421acf182f5 /tests/auto/widgets/widgets/qgroupbox | |
parent | e0c1ae09fd79160015c8399980d2bec4df2273df (diff) |
tst_QGroupBox: port away from Q_FOREACH
These are all simple: QObject::children() returns a reference-to-const
QList, so we can leave the calls in the for loop (no detach()ing).
The loop bodies also clearly don't modify the list of the QObject
children (they're just QVERIFYs).
Pick-to: 6.6 6.5
Task-number: QTBUG-115803
Change-Id: I9c5dcb2aefc433a1dead55dab669e645b6906963
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'tests/auto/widgets/widgets/qgroupbox')
-rw-r--r-- | tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp b/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp index 065310398c..0a182e896f 100644 --- a/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp +++ b/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp @@ -430,7 +430,7 @@ void tst_QGroupBox::childrenAreDisabled() layout->addWidget(new QRadioButton); box.setLayout(layout); - foreach (QObject *object, box.children()) { + for (QObject *object : box.children()) { if (QWidget *widget = qobject_cast<QWidget *>(object)) { QVERIFY(!widget->isEnabled()); QVERIFY(!widget->testAttribute(Qt::WA_ForceDisabled)); @@ -438,7 +438,7 @@ void tst_QGroupBox::childrenAreDisabled() } box.setChecked(true); - foreach (QObject *object, box.children()) { + for (QObject *object : box.children()) { if (QWidget *widget = qobject_cast<QWidget *>(object)) { QVERIFY(widget->isEnabled()); QVERIFY(!widget->testAttribute(Qt::WA_ForceDisabled)); @@ -446,7 +446,7 @@ void tst_QGroupBox::childrenAreDisabled() } box.setChecked(false); - foreach (QObject *object, box.children()) { + for (QObject *object : box.children()) { if (QWidget *widget = qobject_cast<QWidget *>(object)) { QVERIFY(!widget->isEnabled()); QVERIFY(!widget->testAttribute(Qt::WA_ForceDisabled)); |