diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-08-31 13:39:48 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-09-06 00:17:12 +0200 |
commit | 75d1d2a91376c3338510cf1e5fa10feaf8df5785 (patch) | |
tree | d75b6d14ea3f9bb72b10c71c64b21fdb00f9fc13 /src/plugins/platforms | |
parent | 2caa2faf01d66904b912fe1b1b443b5932d928d0 (diff) |
Get rid of hasPendingEvents() and flush()
They are unused.
Change-Id: I77383f2be45551401ed9c2f88285511134cc8b0d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms')
6 files changed, 3 insertions, 44 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h index b8d2532b8e..3226cb1b39 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h @@ -115,7 +115,6 @@ public: ~QCocoaEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags); - bool hasPendingEvents(); void registerSocketNotifier(QSocketNotifier *notifier); void unregisterSocketNotifier(QSocketNotifier *notifier); @@ -129,7 +128,6 @@ public: void wakeUp(); void interrupt(); - void flush(); static void clearCurrentThreadCocoaEventDispatcherInterruptFlag(); diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm index 0480ec0482..bb47e933d2 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm @@ -288,13 +288,6 @@ void QCocoaEventDispatcher::unregisterSocketNotifier(QSocketNotifier *notifier) d->cfSocketNotifier.unregisterSocketNotifier(notifier); } -bool QCocoaEventDispatcher::hasPendingEvents() -{ - extern uint qGlobalPostedEventsCount(); - extern bool qt_is_gui_used; //qapplication.cpp - return qGlobalPostedEventsCount() || (qt_is_gui_used && !CFRunLoopIsWaiting(CFRunLoopGetMain())); -} - static bool isUserInputEvent(NSEvent* event) { switch ([event type]) { @@ -969,9 +962,6 @@ void QCocoaEventDispatcher::interrupt() d->cancelWaitForMoreEvents(); } -void QCocoaEventDispatcher::flush() -{ } - // QTBUG-56746: The behavior of processEvents() has been changed to not clear // the interrupt flag. Use this function to clear it. void QCocoaEventDispatcher::clearCurrentThreadCocoaEventDispatcherInterruptFlag() diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp index 16020557eb..b7df94e60d 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp +++ b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp @@ -86,19 +86,6 @@ public: return QWindowSystemInterface::sendWindowSystemEvents(flags) || didSendEvents; } - - bool hasPendingEvents() override - { - return BaseEventDispatcher::hasPendingEvents() - || QWindowSystemInterface::windowSystemEventsQueued(); - } - - void flush() override - { - if (qApp) - qApp->sendPostedEvents(); - BaseEventDispatcher::flush(); - } }; QOffscreenIntegration::QOffscreenIntegration() diff --git a/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp b/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp index 2e1b083557..1902f8a4a7 100644 --- a/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp +++ b/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp @@ -30,6 +30,7 @@ #include "qwasmeventdispatcher.h" #include <QtCore/qcoreapplication.h> +#include <QtGui/qpa/qwindowsysteminterface.h> #include <emscripten.h> @@ -144,7 +145,8 @@ void QWasmEventDispatcher::doMaintainTimers() // native timer. // Schedule a zero-timer to continue processing any pending events. - if (!m_hasZeroTimer && hasPendingEvents()) { + extern uint qGlobalPostedEventsCount(); // from qapplication.cpp + if (!m_hasZeroTimer && (qGlobalPostedEventsCount() || QWindowSystemInterface::windowSystemEventsQueued())) { auto callback = [](void *eventDispatcher) { QWasmEventDispatcher *that = static_cast<QWasmEventDispatcher *>(eventDispatcher); that->m_hasZeroTimer = false; diff --git a/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp b/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp index 0545bdd5f1..5055057db9 100644 --- a/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp +++ b/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp @@ -63,18 +63,6 @@ bool QXcbUnixEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags return QWindowSystemInterface::sendWindowSystemEvents(flags) || didSendEvents; } -bool QXcbUnixEventDispatcher::hasPendingEvents() -{ - extern uint qGlobalPostedEventsCount(); - return qGlobalPostedEventsCount() || QWindowSystemInterface::windowSystemEventsQueued(); -} - -void QXcbUnixEventDispatcher::flush() -{ - if (qApp) - qApp->sendPostedEvents(); -} - #if QT_CONFIG(glib) struct XcbEventSource { diff --git a/src/plugins/platforms/xcb/qxcbeventdispatcher.h b/src/plugins/platforms/xcb/qxcbeventdispatcher.h index ddf448cf87..8dffeef031 100644 --- a/src/plugins/platforms/xcb/qxcbeventdispatcher.h +++ b/src/plugins/platforms/xcb/qxcbeventdispatcher.h @@ -60,12 +60,6 @@ public: ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; - // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: - // hasPendingEvents() / flush() implementation, so keep it around until - // Qt 6. These methods are deprecated in QAbstractEventDispatcher. - bool hasPendingEvents() override; // ### Qt 6 remove - void flush() override; // ### Qt 6 remove - private: QXcbConnection *m_connection; }; |