diff --git a/examples/corelib/time/calendarbackendplugin/application/main.cpp b/examples/corelib/time/calendarbackendplugin/application/main.cpp index e270bb194b2..0aa35451829 100644 --- a/examples/corelib/time/calendarbackendplugin/application/main.cpp +++ b/examples/corelib/time/calendarbackendplugin/application/main.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include int main(int argc, char *argv[]) diff --git a/examples/qtconcurrent/wordcount/main.cpp b/examples/qtconcurrent/wordcount/main.cpp index 4175641ce93..b157aabe47c 100644 --- a/examples/qtconcurrent/wordcount/main.cpp +++ b/examples/qtconcurrent/wordcount/main.cpp @@ -3,9 +3,11 @@ #include #include +#include #include #include #include +#include typedef QMap WordCount; diff --git a/examples/sql/sqlbrowser/main.cpp b/examples/sql/sqlbrowser/main.cpp index b3fa8af1429..4cfd5db44db 100644 --- a/examples/sql/sqlbrowser/main.cpp +++ b/examples/sql/sqlbrowser/main.cpp @@ -4,6 +4,7 @@ #include "browser.h" #include +#include #include #include #include diff --git a/examples/widgets/graphicsview/chip/chip.cpp b/examples/widgets/graphicsview/chip/chip.cpp index c1a539eddba..c67c5beb2e4 100644 --- a/examples/widgets/graphicsview/chip/chip.cpp +++ b/examples/widgets/graphicsview/chip/chip.cpp @@ -6,6 +6,7 @@ #include #include #include +#include Chip::Chip(const QColor &color, int x, int y) { diff --git a/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp b/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp index cf88932cdb0..75d7eb7e73c 100644 --- a/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp +++ b/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp @@ -4,6 +4,7 @@ #include "mainwindow.h" #include "treemodel.h" +#include #include using namespace Qt::StringLiterals; diff --git a/examples/xml/dombookmarks/xbeltree.cpp b/examples/xml/dombookmarks/xbeltree.cpp index eff2fea8f04..ab158e2c3fd 100644 --- a/examples/xml/dombookmarks/xbeltree.cpp +++ b/examples/xml/dombookmarks/xbeltree.cpp @@ -14,6 +14,7 @@ # include #endif +#include #include using namespace Qt::StringLiterals; diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 9cfd461870b..4af152440c7 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -11,6 +11,7 @@ #include #include +#include #include #include #include diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index 65eaf50e8b3..e0253afa645 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -15,9 +15,6 @@ #include #endif #include -#ifndef QT_NO_DEBUGSTREAM -#include -#endif #ifndef QT_NO_QOBJECT #if defined(Q_OS_WIN) && !defined(tagMSG) @@ -29,6 +26,7 @@ QT_BEGIN_NAMESPACE class QCoreApplicationPrivate; +class QDebug; class QTranslator; #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) class QPostEventList; diff --git a/src/corelib/serialization/qcborcommon.h b/src/corelib/serialization/qcborcommon.h index bd7a93dfe70..202bc49278d 100644 --- a/src/corelib/serialization/qcborcommon.h +++ b/src/corelib/serialization/qcborcommon.h @@ -6,7 +6,6 @@ #include #include -#include #if 0 #pragma qt_class(QtCborCommon) @@ -20,6 +19,8 @@ QT_BEGIN_NAMESPACE +class QDebug; + enum class QCborSimpleType : quint8 { False = 20, True = 21, diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp index 9581015dc11..e9b7d5b71b6 100644 --- a/src/corelib/serialization/qcborvalue.cpp +++ b/src/corelib/serialization/qcborvalue.cpp @@ -15,6 +15,7 @@ #include "qcborstreamwriter.h" #endif +#include #include #include #include diff --git a/src/corelib/thread/qfutureinterface.cpp b/src/corelib/thread/qfutureinterface.cpp index 280615bf76a..7f1b2bef154 100644 --- a/src/corelib/thread/qfutureinterface.cpp +++ b/src/corelib/thread/qfutureinterface.cpp @@ -897,8 +897,8 @@ void QFutureInterfaceBase::setContinuation(std::functioncontinuationState != QFutureInterfaceBasePrivate::Cleaned) { if (d->continuation) { - qWarning() << "Adding a continuation to a future which already has a continuation. " - "The existing continuation is overwritten."; + qWarning("Adding a continuation to a future which already has a continuation. " + "The existing continuation is overwritten."); } d->continuation = std::move(func); d->continuationData = continuationFutureData; diff --git a/src/corelib/time/qtimezonelocale.cpp b/src/corelib/time/qtimezonelocale.cpp index 21002373d7a..1ea1f40b701 100644 --- a/src/corelib/time/qtimezonelocale.cpp +++ b/src/corelib/time/qtimezonelocale.cpp @@ -245,8 +245,9 @@ const MetaZoneData *metaZoneDataFor(const MetaZoneData *from, QLocale::Territory // Fall back to World (if territory itself isn't World). } while (std::exchange(land, QLocale::World) != QLocale::World); - qWarning() << "Metazone" << from->metaZoneId() << "lacks World data for" - << QLocale::territoryToString(territory); + qWarning("Metazone %s lacks World data for %ls", + from->metaZoneId().constData(), + qUtf16Printable(QLocale::territoryToString(territory))); return nullptr; } diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index 9986689ffed..b552914ee6f 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -15,7 +15,6 @@ #if QT_CONFIG(accessibility) #include -#include #include #include #include @@ -28,6 +27,7 @@ QT_BEGIN_NAMESPACE +class QDebug; class QAccessibleInterface; class QAccessibleEvent; class QWindow; diff --git a/src/gui/vulkan/qvulkaninstance.h b/src/gui/vulkan/qvulkaninstance.h index 221f605fa2a..819751025be 100644 --- a/src/gui/vulkan/qvulkaninstance.h +++ b/src/gui/vulkan/qvulkaninstance.h @@ -48,7 +48,6 @@ typedef int VkDebugReportObjectTypeEXT; #if __has_include() || defined(Q_QDOC) #include -#include #include #include #include @@ -56,6 +55,8 @@ typedef int VkDebugReportObjectTypeEXT; QT_BEGIN_NAMESPACE +class QDebug; + class QVulkanInstancePrivate; class QPlatformVulkanInstance; class QVulkanFunctions; diff --git a/src/network/access/qhttpmultipart.cpp b/src/network/access/qhttpmultipart.cpp index 2249dbc05ce..f5b9745c3f3 100644 --- a/src/network/access/qhttpmultipart.cpp +++ b/src/network/access/qhttpmultipart.cpp @@ -4,6 +4,7 @@ #include "qhttpmultipart.h" #include "qhttpmultipart_p.h" #include "QtCore/qdatetime.h" // for initializing the random number generator with QTime +#include #include "QtCore/qmutex.h" #include "QtCore/qrandom.h" diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h index fa312bfe6f7..5b687785593 100644 --- a/src/network/access/qnetworkrequest.h +++ b/src/network/access/qnetworkrequest.h @@ -13,6 +13,8 @@ #include +#include + QT_BEGIN_NAMESPACE class QSslConfiguration; diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index e456d00713b..9976a9c1260 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -435,6 +435,7 @@ #include "private/qhostinfo_p.h" #include +#include #include #include #include diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h index 1d5d45096ab..75e35e6de3f 100644 --- a/src/network/socket/qabstractsocket.h +++ b/src/network/socket/qabstractsocket.h @@ -13,12 +13,10 @@ #endif #include #include -#ifndef QT_NO_DEBUG_STREAM -#include -#endif QT_BEGIN_NAMESPACE +class QDebug; class QHostAddress; #ifndef QT_NO_NETWORKPROXY diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp index dff7e428495..39178b42aab 100644 --- a/src/network/socket/qlocalsocket.cpp +++ b/src/network/socket/qlocalsocket.cpp @@ -6,6 +6,8 @@ #include "qlocalsocket.h" #include "qlocalsocket_p.h" +#include + QT_BEGIN_NAMESPACE /*! diff --git a/src/network/socket/qlocalsocket.h b/src/network/socket/qlocalsocket.h index 2bd9689a052..3187bb43b1b 100644 --- a/src/network/socket/qlocalsocket.h +++ b/src/network/socket/qlocalsocket.h @@ -8,14 +8,11 @@ #include #include -#ifndef QT_NO_DEBUG_STREAM -#include -#endif - QT_REQUIRE_CONFIG(localserver); QT_BEGIN_NAMESPACE +class QDebug; class QLocalSocketPrivate; class Q_NETWORK_EXPORT QLocalSocket : public QIODevice diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h index 1f461bf26d7..7103a68df23 100644 --- a/src/network/ssl/qsslerror.h +++ b/src/network/ssl/qsslerror.h @@ -6,6 +6,7 @@ #define QSSLERROR_H #include +#include #include #include diff --git a/src/opengl/qopengldebug.h b/src/opengl/qopengldebug.h index 843ab7212ae..f9a40313ad8 100644 --- a/src/opengl/qopengldebug.h +++ b/src/opengl/qopengldebug.h @@ -12,7 +12,6 @@ #include #include #include -#include #include #if defined(Q_QDOC) @@ -22,6 +21,7 @@ typedef unsigned int GLuint; QT_BEGIN_NAMESPACE +class QDebug; class QOpenGLDebugLogger; class QOpenGLDebugLoggerPrivate; class QOpenGLDebugMessagePrivate; diff --git a/src/plugins/platforms/qnx/qqnxkeytranslator.h b/src/plugins/platforms/qnx/qqnxkeytranslator.h index 5e0dd56e2e3..d48792c10ec 100644 --- a/src/plugins/platforms/qnx/qqnxkeytranslator.h +++ b/src/plugins/platforms/qnx/qqnxkeytranslator.h @@ -6,10 +6,6 @@ #include -#if defined(QQNXEVENTTHREAD_DEBUG) -#include -#endif - QT_BEGIN_NAMESPACE int qtKeyForPrivateUseQnxKey( int key ) @@ -79,7 +75,7 @@ int qtKeyForPrivateUseQnxKey( int key ) default: #if defined(QQNXEVENTTHREAD_DEBUG) - qDebug() << "QQNX: unknown key for translation:" << key; + qDebug("QQNX: unknown key for translation: %d", key); #endif break; } diff --git a/src/plugins/platforms/wasm/qwasmdom.cpp b/src/plugins/platforms/wasm/qwasmdom.cpp index b6f6be898ec..71efcee7887 100644 --- a/src/plugins/platforms/wasm/qwasmdom.cpp +++ b/src/plugins/platforms/wasm/qwasmdom.cpp @@ -3,6 +3,7 @@ #include "qwasmdom.h" +#include #include #include #include diff --git a/src/testlib/qtesttostring.h b/src/testlib/qtesttostring.h index e8ada71f9ea..8ea899323f6 100644 --- a/src/testlib/qtesttostring.h +++ b/src/testlib/qtesttostring.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/src/tools/androidtestrunner/main.cpp b/src/tools/androidtestrunner/main.cpp index 228aa676f5b..8dd2d550705 100644 --- a/src/tools/androidtestrunner/main.cpp +++ b/src/tools/androidtestrunner/main.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include