diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-09-20 16:47:44 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-09-20 19:33:04 +0200 |
commit | 9045d4ad8cf5ecd467876d022599a78d0de4d2ae (patch) | |
tree | e2cae53d774f6ab3319e3da58e342582c76c62e7 /tests | |
parent | 00c938441f5d0a149a7fbabd02392baeb76cb769 (diff) |
Replace foreach with range-for in tst_qqmlparser
Amends 5fbb714cc12ced4e36d7af70e883a68ad54817ac
Change-Id: I1d64202ab1bab5e037ceaa6f571e18b2472fee1c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qqmlparser/tst_qqmlparser.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp index 53b88099b..101404728 100644 --- a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp +++ b/tests/auto/qml/qqmlparser/tst_qqmlparser.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 <private/qqmljsengine_p.h> #include <private/qqmljsparser_p.h> #include <private/qqmljslexer_p.h> @@ -112,13 +110,12 @@ QStringList tst_qqmlparser::findFiles(const QDir &d) QStringList files = d.entryList(QStringList() << QLatin1String("*.qml") << QLatin1String("*.js"), QDir::Files); - foreach (const QString &file, files) { + for (const auto &file : files) rv << d.absoluteFilePath(file); - } QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks); - foreach (const QString &dir, dirs) { + for (const auto &dir : dirs) { QDir sub = d; sub.cd(dir); rv << findFiles(sub); @@ -144,7 +141,7 @@ void tst_qqmlparser::qmlParser_data() files << findFiles(QDir(examples)); files << findFiles(QDir(tests)); - foreach (const QString &file, files) + for (const auto &file : files) QTest::newRow(qPrintable(file)) << file; } #endif |