From 02add2a807c80c4dbcfd3eb875f281813eda7ac3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 8 Aug 2023 20:13:08 +0200 Subject: [PATCH] tst_QImageReader: fix a trivial Q_FOREACH and remove #undef QT_NO_FOREACH Other recent commits have fixed the other Q_FOREACH uses in this file. Task-number: QTBUG-115839 Change-Id: I03063f3e8f1e99c5a2aa2d9188260f3e79ca43bd Reviewed-by: Ahmad Samir Reviewed-by: Fabian Kosmale --- tests/auto/gui/image/qimagereader/tst_qimagereader.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp index ff5e67ec292..d404a9871ca 100644 --- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.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 #include @@ -1832,13 +1830,13 @@ void tst_QImageReader::testIgnoresFormatAndExtension() SKIP_IF_UNSUPPORTED(expected.toLatin1()); - QList formats = QImageReader::supportedImageFormats(); + const QList formats = QImageReader::supportedImageFormats(); QString fileNameBase = prefix + name + QLatin1Char('.'); QString tempPath = m_temporaryDir.path(); if (!tempPath.endsWith(QLatin1Char('/'))) tempPath += QLatin1Char('/'); - foreach (const QByteArray &f, formats) { + for (const QByteArray &f : formats) { if (f == extension.toLocal8Bit()) continue;