summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-08-08 20:13:08 +0200
committerAhmad Samir <a.samirh78@gmail.com>2023-08-19 08:19:47 +0300
commit02add2a807c80c4dbcfd3eb875f281813eda7ac3 (patch)
tree6710dad5832bdc1faf8ee702e0f54d456d7383ab
parent11d69325605071a32d10ed4392c67e9a07445ada (diff)
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 <a.samirh78@gmail.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp6
1 files 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 ff5e67ec29..d404a9871c 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 <QTest>
#include <QBuffer>
@@ -1832,13 +1830,13 @@ void tst_QImageReader::testIgnoresFormatAndExtension()
SKIP_IF_UNSUPPORTED(expected.toLatin1());
- QList<QByteArray> formats = QImageReader::supportedImageFormats();
+ const QList<QByteArray> 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;