From f2fea2325de7554e226767d94eb01574a069a324 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 17 May 2022 09:32:49 +0200 Subject: [PATCH] Remove manual declarations of qGlobalPostedEventsCount() ... in favor of including qabstracteventdispatcher_p.h, where needed. Keeps the code DRY. Change-Id: I5bee2e653cb29ffac2601ff03c952a4b3adbdb9c Reviewed-by: Thiago Macieira --- src/corelib/kernel/qeventdispatcher_wasm.cpp | 2 +- src/corelib/kernel/qeventdispatcher_win.cpp | 2 -- .../corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp | 5 +---- tests/auto/corelib/thread/qthread/tst_qthread.cpp | 4 ---- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_wasm.cpp b/src/corelib/kernel/qeventdispatcher_wasm.cpp index 6c8f878f905..d2b01905fe8 100644 --- a/src/corelib/kernel/qeventdispatcher_wasm.cpp +++ b/src/corelib/kernel/qeventdispatcher_wasm.cpp @@ -3,6 +3,7 @@ #include "qeventdispatcher_wasm_p.h" +#include // for qGlobalPostedEventsCount() #include #include #include @@ -14,7 +15,6 @@ QT_BEGIN_NAMESPACE // using namespace emscripten; -extern int qGlobalPostedEventsCount(); // from qapplication.cpp Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher"); Q_LOGGING_CATEGORY(lcEventDispatcherTimers, "qt.eventdispatcher.timers"); diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 6f9f07240d7..709e1494b90 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -18,8 +18,6 @@ QT_BEGIN_NAMESPACE -extern uint qGlobalPostedEventsCount(); - #ifndef TIME_KILL_SYNCHRONOUS # define TIME_KILL_SYNCHRONOUS 0x0100 #endif diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp index 19767f945c4..0e64de151a0 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp @@ -7,6 +7,7 @@ #include #include +#include // for qGlobalPostedEventsCount() #include #include #include @@ -513,10 +514,6 @@ void tst_QCoreApplication::applicationPid() QVERIFY(QCoreApplication::applicationPid() > 0); } -QT_BEGIN_NAMESPACE -Q_CORE_EXPORT uint qGlobalPostedEventsCount(); -QT_END_NAMESPACE - class GlobalPostedEventsCountObject : public QObject { Q_OBJECT diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp index 70ed8b523b2..125c969ea26 100644 --- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp +++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp @@ -1195,10 +1195,6 @@ void tst_QThread::isRunningInFinished() } } -QT_BEGIN_NAMESPACE -Q_CORE_EXPORT uint qGlobalPostedEventsCount(); -QT_END_NAMESPACE - class DummyEventDispatcher : public QAbstractEventDispatcher { public: DummyEventDispatcher() : QAbstractEventDispatcher() {}