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 #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;