Mark all of Qt as free of Q_FOREACH, except where it isn't

The density of Q_FOREACH uses in this and some other modules is still
extremely high, too high for anyone to tackle in a short amount of
time. Even if they're not concentrated in just a few TUs, we need to
make progress on a global QT_NO_FOREACH default, so grab the nettle
and stick to our strategy:

Mark the whole of Qt with QT_NO_FOREACH, to prevent new uses from
creeping in, and whitelist the affected TUs by #undef'ing
QT_NO_FOREACH locally, at the top of each file. For TUs that are part
of a larger executable, this requires these files to be compiled
separately, so add them to NO_PCH_SOURCES (which implies
NO_UNITY_BUILD_SOURCES, too).

In tst_qglobal.cpp and tst_qcollections.cpp change the comment on the
#undef QT_NO_FOREACH to indicate that these actually test the macro.

Task-number: QTBUG-115839
Change-Id: Iecc444eb7d43d7e4d037f6e155abe0e14a00a5d6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Marc Mutz 2023-08-07 17:59:46 +02:00 committed by Edward Welbourne
parent 1a3f573bd9
commit 11d6932560
116 changed files with 218 additions and 5 deletions

View File

@ -161,6 +161,7 @@ qt_internal_add_global_definition(QT_NO_QEXCHANGE)
qt_internal_add_global_definition(QT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
qt_internal_add_global_definition(QT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH)
qt_internal_add_global_definition(QT_USE_QSTRINGBUILDER SCOPE PLUGIN TOOL MODULE)
qt_internal_add_global_definition(QT_NO_FOREACH)
if(WARNINGS_ARE_ERRORS)
qt_internal_set_warnings_are_errors_flags(PlatformModuleInternal INTERFACE)

View File

@ -1,6 +1,8 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
//! [0]
class Employee
{

View File

@ -1,6 +1,8 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include <QtGui>
#include <QtDebug>
#include <QQmlComponent>

View File

@ -1,6 +1,8 @@
// Copyright (C) 2014 Ivan Komissarov
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
//! [0]
QStorageInfo storage(qApp->applicationDirPath());
if (storage.isValid() && storage.isReady()) {

View File

@ -1,6 +1,8 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
//! [0]
QMouseEvent event(QEvent::MouseButtonPress, pos, 0, 0, 0);
QApplication::sendEvent(mainWindow, &event);

View File

@ -1,6 +1,8 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
//! [0]
void MyWidget::dragEnterEvent(QDragEnterEvent *event)
{

View File

@ -1,6 +1,8 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
//! [0]
QDataStream out(...);
QVariant v(123); // The variant now contains an int

View File

@ -33,8 +33,6 @@ qt_internal_add_plugin(QIOSIntegrationPlugin
qiosintegration.mm # undef QT_NO_FOREACH
qiosplatformaccessibility.mm # undef QT_NO_FOREACH
qiosscreen.mm # undef QT_NO_FOREACH
DEFINES
QT_NO_FOREACH
LIBRARIES
${FWAudioToolbox}
${FWFoundation}

View File

@ -37,8 +37,6 @@ qt_internal_add_plugin(QQnxIntegrationPlugin
qqnxscreen.cpp # undef QT_NO_FOREACH
qqnxscreeneventhandler.cpp # undef QT_NO_FOREACH
qqnxwindow.cpp # undef QT_NO_FOREACH
DEFINES
QT_NO_FOREACH
LIBRARIES
Qt::Core
Qt::CorePrivate

View File

@ -27,7 +27,6 @@ qt_internal_add_plugin(QGtk3ThemePlugin
qgtk3dialoghelpers.cpp # undef QT_NO_FOREACH
DEFINES
GDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_6
QT_NO_FOREACH
LIBRARIES
PkgConfig::GTK3
Qt::Core

View File

@ -1,5 +1,8 @@
// 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 <qtconcurrentmedian.h>
#include <QTest>

View File

@ -1,5 +1,8 @@
// 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 <qtconcurrentthreadengine.h>
#include <qexception.h>
#include <QThread>

View File

@ -15,6 +15,8 @@ qt_internal_add_test(tst_qglobal
SOURCES
qglobal.c
tst_qglobal.cpp
NO_PCH_SOURCES
tst_qglobal.cpp # undef QT_NO_FOREACH
)
## Scopes:

View File

@ -2,6 +2,8 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#undef QT_NO_FOREACH // this file tests Q_FOREACH!
#include <QTest>
#include <QPair>

View File

@ -1,6 +1,8 @@
// 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 <QtCore/private/qabstractfileengine_p.h>
#include <QtCore/private/qfsfileengine_p.h>

View File

@ -2,6 +2,8 @@
// Copyright (C) 2017 Intel Corporation.
// 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 <QTemporaryFile>
#if QT_CONFIG(process)

View File

@ -1,6 +1,7 @@
// Copyright (C) 2021 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>

View File

@ -2,6 +2,8 @@
// Copyright (C) 2021 Intel Corporation.
// 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
#define _CRT_SECURE_NO_WARNINGS 1
#include <QTest>

View File

@ -1,6 +1,8 @@
// Copyright (C) 2021 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 <QStandardPaths>
#include <QScopeGuard>

View File

@ -1,6 +1,8 @@
// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
// 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 <qplatformdefs.h>

View File

@ -1,5 +1,8 @@
// Copyright (C) 2021 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 <QCoreApplication>

View File

@ -2,6 +2,7 @@
// Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
// 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 <QtConcurrentRun>

View File

@ -2,6 +2,8 @@
// Copyright (C) 2020 Intel Corporation.
// 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 <qstandardpaths.h>
#include <QTest>
#include <QOperatingSystemVersion>

View File

@ -1,6 +1,8 @@
// Copyright (C) 2014 Ivan Komissarov <ABBAPOH@gmail.com>
// 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 <QStorageInfo>
#include <QTemporaryFile>

View File

@ -1,6 +1,7 @@
// Copyright (C) 2021 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 <QStandardPaths>

View File

@ -2,6 +2,8 @@
// Copyright (C) 2017 Intel Corporation.
// 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 <qcoreapplication.h>
#include <qstring.h>

View File

@ -1,6 +1,8 @@
// 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 <QMimeData>

View File

@ -3,6 +3,8 @@
// Copyright (C) 2016 Intel Corporation.
// 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 <qvariant.h>
// don't assume <type_traits>

View File

@ -1,6 +1,8 @@
// 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 "tst_qmimedatabase.h"
#include <qmimedatabase.h>

View File

@ -1,5 +1,8 @@
// Copyright (C) 2020 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
#define QFUTURE_TEST
#include <QCoreApplication>

View File

@ -1,6 +1,7 @@
// 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 tests Q_FOREACH over containers (centralize in a tst_qforeach?)
// test the container forwards
#include <QtContainerFwd>

View File

@ -1,6 +1,7 @@
// Copyright (C) 2021 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 <QtCore/QString>

View File

@ -1,6 +1,8 @@
// 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 <qeasingcurve.h>

View File

@ -1,6 +1,7 @@
// 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 <QtCore/QCoreApplication>
#include <QtCore/QElapsedTimer>

View File

@ -1,6 +1,8 @@
// Copyright (C) 2021 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 <QAtomicInt>
#include <QThread>

View File

@ -9,6 +9,8 @@ qt_internal_add_test(tst_qdbusmarshall
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../"
SOURCES
../tst_qdbusmarshall.cpp
NO_PCH_SOURCES
../tst_qdbusmarshall.cpp # undef QT_NO_FOREACH
LIBRARIES
Qt::CorePrivate
Qt::DBusPrivate

View File

@ -1,6 +1,9 @@
// Copyright (C) 2016 The Qt Company Ltd.
// Copyright (C) 2016 Intel Corporation.
// 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 <QtCore/QtCore>
#include <QTest>
#include <QTestEventLoop>

View File

@ -1,6 +1,8 @@
// 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 <QCoreApplication>
#include <QDomDocument>
#include <QMetaType>

View File

@ -1,6 +1,7 @@
// 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>

View File

@ -1,6 +1,8 @@
// Copyright (C) 2017 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 <QtCore/qcoreapplication.h>

View File

@ -1,6 +1,8 @@
// 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 <QtCore/qmath.h>
#include <QtGui/qquaternion.h>

View File

@ -1,6 +1,7 @@
// 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 <qpainter.h>

View File

@ -1,5 +1,8 @@
// 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 <QtXml/QtXml>
#include <QtGui/QFontInfo>

View File

@ -1,6 +1,8 @@
// 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>
#include <QtEndian>

View File

@ -1,6 +1,8 @@
// 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 <qglyphrun.h>

View File

@ -1,6 +1,7 @@
// 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
/*
!!!!!! Warning !!!!!

View File

@ -1,6 +1,7 @@
// 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 <QtCore/QJsonArray>

View File

@ -1,6 +1,8 @@
// 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 <QtNetwork/QtNetwork>
#include <QTest>
#include <QTestEventLoop>

View File

@ -24,6 +24,8 @@ qt_internal_add_test(tst_qnetworkreply
../tst_qnetworkreply.cpp
../data/gzip.rcc.cpp
../data/zstandard.rcc.cpp
NO_PCH_SOURCES
../tst_qnetworkreply.cpp # undef QT_NO_FOREACH
LIBRARIES
Qt::CorePrivate
Qt::NetworkPrivate

View File

@ -1,6 +1,8 @@
// Copyright (C) 2021 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 <QtNetwork/qtnetworkglobal.h>
#include <QTest>

View File

@ -2,6 +2,7 @@
// Copyright (C) 2016 Intel Corporation.
// 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 <QSignalSpy>

View File

@ -2,6 +2,7 @@
// Copyright (C) 2016 Intel Corporation.
// 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 <QtEndian>

View File

@ -1,6 +1,7 @@
// 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 <QtTest/QTest>
#include <QtTest/QTestEventLoop>

View File

@ -1,6 +1,8 @@
// 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 <qglobal.h>
#if defined(_WIN32)
#include <winsock2.h>

View File

@ -2,6 +2,8 @@
// Copyright (C) 2017 Intel Corporation.
// 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 <qglobal.h>
#if defined(_WIN32)

View File

@ -2,6 +2,7 @@
// Copyright (C) 2017 Intel Corporation.
// 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 <QSignalSpy>

View File

@ -1,6 +1,8 @@
// 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 <QtNetwork/qtnetworkglobal.h>

View File

@ -1,6 +1,7 @@
// Copyright (C) 2014 Governikus GmbH & Co. KG.
// 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>

View File

@ -1,6 +1,8 @@
// 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 <qsslkey.h>
#include <qsslsocket.h>

View File

@ -1,6 +1,7 @@
// 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 <QtTest/qtesttouch.h>

View File

@ -22,6 +22,8 @@ qt_internal_add_test(tst_macgui
SOURCES
guitest.cpp guitest.h
tst_macgui.cpp
NO_PCH_SOURCES
guitest.cpp # undef QT_NO_FOREACH
LIBRARIES
Qt::CorePrivate
Qt::WidgetsPrivate

View File

@ -1,6 +1,7 @@
// 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 "guitest.h"
#include <QDebug>

View File

@ -1,6 +1,7 @@
// 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 <QtCore/qglobal.h>
#ifdef Q_OS_WIN

View File

@ -1,6 +1,8 @@
// Copyright (C) 2014 John Layt <jlayt@kde.org>
// 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 <QMimeType>

View File

@ -1,6 +1,8 @@
// 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 <qprinter.h>

View File

@ -15,6 +15,8 @@ qt_internal_add_test(tst_qabstractitemmodeltester
SOURCES
../../other/qabstractitemmodelutils/dynamictreemodel.cpp ../../other/qabstractitemmodelutils/dynamictreemodel.h
tst_qabstractitemmodeltester.cpp
NO_PCH_SOURCES
tst_qabstractitemmodeltester.cpp # undef QT_NO_FOREACH
INCLUDE_DIRECTORIES
../../other/qabstractitemmodelutils
LIBRARIES

View File

@ -1,6 +1,8 @@
// 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 <QAbstractItemModelTester>
#include <QtGui/QtGui>

View File

@ -27,6 +27,8 @@ qt_internal_add_test(tst_selftests
SOURCES
tst_selftests.cpp
catch.cpp
NO_PCH_SOURCES
tst_selftests.cpp # undef QT_NO_FOREACH
LIBRARIES
Qt::TestPrivate
TESTDATA ${qmake_expected_files_resource_files}

View File

@ -1,6 +1,7 @@
// 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 <QtCore/QCoreApplication>
#include <QtCore/QStringList>

View File

@ -2,6 +2,8 @@
// Copyright (C) 2016 Intel Corporation.
// 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 <QtCore/QCoreApplication>
QT_REQUIRE_CONFIG(process);

View File

@ -72,6 +72,8 @@ qt_internal_add_test(tst_moc
cxx-attributes.h
tst_moc.cpp
${comparison_relevant_moc_list}
NO_PCH_SOURCES
tst_moc.cpp # undef QT_NO_FOREACH
INCLUDE_DIRECTORIES
testproject
testproject/include

View File

@ -2,6 +2,8 @@
// Copyright (C) 2020 Olivier Goffart <ogoffart@woboq.com>
// 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 <QSignalSpy>
#include <stdio.h>

View File

@ -17,6 +17,8 @@ qt_internal_add_test(tst_qmake
SOURCES
testcompiler.cpp testcompiler.h
tst_qmake.cpp
NO_PCH_SOURCES
testcompiler.cpp # undef QT_NO_FOREACH
TESTDATA ${test_data}
)

View File

@ -1,6 +1,8 @@
// 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 "testcompiler.h"
#include <QProcess>

View File

@ -24,6 +24,9 @@ qt_internal_add_test(tst_qmakelib
evaltest.cpp
parsertest.cpp
tst_qmakelib.cpp tst_qmakelib.h
NO_PCH_SOURCES
evaltest.cpp # undef QT_NO_FOREACH
parsertest.cpp # undef QT_NO_FOREACH
DEFINES
PROEVALUATOR_FULL
PROEVALUATOR_SETENV

View File

@ -1,6 +1,8 @@
// 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 "tst_qmakelib.h"
#include <proitems.h>

View File

@ -1,6 +1,8 @@
// 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 "tst_qmakelib.h"
#include <proitems.h>

View File

@ -17,6 +17,8 @@ qt_internal_add_test(tst_baseline_painting
../shared/qbaselinetest.cpp ../shared/qbaselinetest.h
../shared/paintcommands.cpp ../shared/paintcommands.h
tst_baseline_painting.cpp
NO_PCH_SOURCES
tst_baseline_painting.cpp # undef QT_NO_FOREACH
INCLUDE_DIRECTORIES
../shared
LIBRARIES

View File

@ -1,6 +1,8 @@
// 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 "paintcommands.h"
#include <qbaselinetest.h>
#include <QDir>

View File

@ -1,6 +1,8 @@
// 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 <QDirIterator>

View File

@ -9,6 +9,8 @@ qt_internal_add_benchmark(tst_bench_qhash
SOURCES
tst_bench_qhash.cpp
outofline.cpp
NO_PCH_SOURCES
tst_bench_qhash.cpp # undef QT_NO_FOREACH
INCLUDE_DIRECTORIES
.
LIBRARIES

View File

@ -2,6 +2,8 @@
// Copyright (C) 2016 Intel Corporation.
// 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 "tst_bench_qhash.h"
#include <QFile>

View File

@ -2,6 +2,8 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
// This file contains benchmarks for QRect/QRectF functions.
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include <QDebug>
#include <qtest.h>

View File

@ -1,6 +1,8 @@
// 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.h>
#include <QPainter>
#include <QPainterPath>

View File

@ -1,6 +1,8 @@
// Copyright (C) 2020 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.h>
#include <QtCore/qmath.h>

View File

@ -11,6 +11,8 @@ qt_internal_add_manual_test(Menurama
main.cpp
mainwindow.cpp mainwindow.h mainwindow.ui
menuramaapplication.cpp menuramaapplication.h
NO_PCH_SOURCES
menuramaapplication.cpp # undef QT_NO_FOREACH
LIBRARIES
Qt::Gui
Qt::Widgets

View File

@ -1,6 +1,8 @@
// Copyright (C) 2017 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 "menuramaapplication.h"
MenuramaApplication::MenuramaApplication(int &argc, char **argv)

View File

@ -15,6 +15,9 @@ qt_internal_add_manual_test(dialogs
messageboxpanel.cpp messageboxpanel.h
utils.cpp utils.h
wizardpanel.cpp wizardpanel.h
NO_PCH_SOURCES
filedialogpanel.cpp # undef QT_NO_FOREACH
utils.cpp # undef QT_NO_FOREACH
LIBRARIES
Qt::Gui
Qt::Widgets
@ -31,6 +34,8 @@ qt_internal_extend_target(dialogs CONDITION TARGET Qt::PrintSupport
qt_internal_extend_target(dialogs CONDITION NOT (QT_FEATURE_printer EQUAL FALSE)
SOURCES
printdialogpanel.cpp printdialogpanel.h printdialogpanel.ui
NO_PCH_SOURCES
printdialogpanel.cpp # undef QT_NO_FOREACH
ENABLE_AUTOGEN_TOOLS
uic
)

View File

@ -1,6 +1,8 @@
// Copyright (C) 2021 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 "filedialogpanel.h"
#include "utils.h"

View File

@ -1,6 +1,8 @@
// 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
#ifndef QT_NO_PRINTER
#include "printdialogpanel.h"

View File

@ -1,6 +1,8 @@
// 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 "utils.h"
#include <QCheckBox>

View File

@ -13,6 +13,8 @@ qt_internal_add_manual_test(embeddedintoforeignwindow
../diaglib/textdump.cpp ../diaglib/textdump.h
itemwindow.cpp itemwindow.h
main.cpp
NO_PCH_SOURCES
itemwindow.cpp # undef QT_NO_FOREACH
DEFINES
QT_DIAG_LIB
INCLUDE_DIRECTORIES

View File

@ -1,6 +1,8 @@
// Copyright (C) 2017 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 "itemwindow.h"
#include <QtGui/QPainter>

View File

@ -10,6 +10,8 @@ qt_internal_add_manual_test(scrollarea
SOURCES
main.cpp
mousepangesturerecognizer.cpp mousepangesturerecognizer.h
NO_PCH_SOURCES
main.cpp # undef QT_NO_FOREACH
LIBRARIES
Qt::Gui
Qt::Widgets

View File

@ -1,6 +1,8 @@
// 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 <QApplication>
#include <QSlider>
#include <QScrollArea>

View File

@ -11,6 +11,8 @@ qt_internal_add_manual_test(lance
interactivewidget.cpp interactivewidget.h
main.cpp
widgets.h
NO_PCH_SOURCES
interactivewidget.cpp # undef QT_NO_FOREACH
INCLUDE_DIRECTORIES
.
../../baseline/shared

View File

@ -1,5 +1,8 @@
// 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 "interactivewidget.h"
#include <QtWidgets>

View File

@ -11,6 +11,8 @@ qt_internal_add_manual_test(qgraphicsitemgroup
customitem.cpp customitem.h
main.cpp
widget.cpp widget.h widget.ui
NO_PCH_SOURCES
widget.cpp # undef QT_NO_FOREACH
LIBRARIES
Qt::Gui
Qt::Widgets

View File

@ -1,6 +1,8 @@
// 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 "widget.h"
#include "ui_widget.h"
#include <QGraphicsOpacityEffect>

View File

@ -17,6 +17,8 @@ qt_internal_add_manual_test(qlocale
miscellaneous.cpp miscellaneous.h
numberformats.cpp numberformats.h
window.cpp window.h
NO_PCH_SOURCES
languages.cpp # undef QT_NO_FOREACH
LIBRARIES
Qt::Gui
Qt::Widgets

Some files were not shown because too many files have changed in this diff Show More