diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-08-14 02:54:07 +0300 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-08-25 18:56:28 +0300 |
commit | 788d19439ba3548bb10ddfbf88efbf54205dd065 (patch) | |
tree | 569d6776d1e9502ad7d3cb69a83ff06671dd8046 /tests/auto/other/qaccessibility/tst_qaccessibility.cpp | |
parent | bfca8c6d2447558609b4cce71d112a8ab34b8bec (diff) |
tst_QAccessibility: compile with QT_NO_FOREACH
QObject::children() returns a const QList&, and nothing in the loop body
changes the objects children, so straightforward port to ranged-for.
Task-number: QTBUG-115839
Change-Id: I78827fd986d6ff2607cc2616ff23580c9d830f1b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'tests/auto/other/qaccessibility/tst_qaccessibility.cpp')
-rw-r--r-- | tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 5cc7404e91..3580e3c844 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1,8 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses - #include <QtCore/qglobal.h> #ifdef Q_OS_WIN # include <QtCore/qt_windows.h> @@ -3453,7 +3451,7 @@ void tst_QAccessibility::calendarWidgetTest() QCOMPARE(interface->rect(), globalGeometry); QWidget *navigationBar = 0; - foreach (QObject *child, calendarWidget.children()) { + for (QObject *child : calendarWidget.children()) { if (child->objectName() == QLatin1String("qt_calendar_navigationbar")) { navigationBar = static_cast<QWidget *>(child); break; @@ -3463,7 +3461,7 @@ void tst_QAccessibility::calendarWidgetTest() QVERIFY(verifyChild(navigationBar, interface, 0, globalGeometry)); QAbstractItemView *calendarView = 0; - foreach (QObject *child, calendarWidget.children()) { + for (QObject *child : calendarWidget.children()) { if (child->objectName() == QLatin1String("qt_calendar_calendarview")) { calendarView = static_cast<QAbstractItemView *>(child); break; |