diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-08-07 10:20:42 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-08-22 20:11:34 +0200 |
commit | d3c05159510efd7862ef8c8bfc9b0adc3963a25b (patch) | |
tree | 4e8f66f441ae99d6935b6b4c0ba2ed38702b1225 /tests/auto/qml/qqmlecmascript | |
parent | 1d3385e9887e912a79835c7defc878edf4ab7ec5 (diff) |
Remove remaining foreach in qml tests
Task-number: QTBUG-115808
Change-Id: If02f3cbb97e8a6035544d10ee2c23f5c87ed618c
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/testtypes.cpp | 4 |
2 files changed, 1 insertions, 5 deletions
diff --git a/tests/auto/qml/qqmlecmascript/CMakeLists.txt b/tests/auto/qml/qqmlecmascript/CMakeLists.txt index 8e52d026c0..12cab47a36 100644 --- a/tests/auto/qml/qqmlecmascript/CMakeLists.txt +++ b/tests/auto/qml/qqmlecmascript/CMakeLists.txt @@ -23,8 +23,6 @@ qt_internal_add_test(tst_qqmlecmascript SOURCES testtypes.cpp testtypes.h tst_qqmlecmascript.cpp - NO_PCH_SOURCES - testtypes.cpp # undef QT_NO_FOREACH LIBRARIES Qt::CorePrivate Qt::Gui diff --git a/tests/auto/qml/qqmlecmascript/testtypes.cpp b/tests/auto/qml/qqmlecmascript/testtypes.cpp index 9dbcd24fee..be7c7cedce 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.cpp +++ b/tests/auto/qml/qqmlecmascript/testtypes.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 "testtypes.h" #ifndef QT_NO_WIDGETS # include <QWidget> @@ -415,7 +413,7 @@ QObject *QObjectContainer::children_at(QQmlListProperty<QObject> *prop, qsizetyp void QObjectContainer::children_clear(QQmlListProperty<QObject> *prop) { QObjectContainer *that = static_cast<QObjectContainer*>(prop->object); - foreach (QObject *c, that->dataChildren) + for (QObject *c : std::as_const(that->dataChildren)) QObject::disconnect(c, SIGNAL(destroyed(QObject*)), that, SLOT(childDestroyed(QObject*))); that->dataChildren.clear(); } |