From 1284b2c427eedbe821304dc16ef42a3afcc15ba2 Mon Sep 17 00:00:00 2001 From: ali kettab Date: Sun, 2 Mar 2025 00:31:22 +0100 Subject: [PATCH] wxQt: Make wxEventLoop::Pending() return false unconditionally and document that Because implementing this function reliably in wxQt is difficult, if not possible. --- interface/wx/evtloop.h | 2 ++ src/qt/evtloop.cpp | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/interface/wx/evtloop.h b/interface/wx/evtloop.h index 5d3d446f22..d8e2eac974 100644 --- a/interface/wx/evtloop.h +++ b/interface/wx/evtloop.h @@ -133,6 +133,8 @@ public: Return true if any events are available. If this method returns @true, calling Dispatch() will not block. + + @note This function always returns @false under wxQt since 3.3.0 */ virtual bool Pending() const = 0; diff --git a/src/qt/evtloop.cpp b/src/qt/evtloop.cpp index 73e9536fb8..90c3d7708f 100644 --- a/src/qt/evtloop.cpp +++ b/src/qt/evtloop.cpp @@ -126,8 +126,15 @@ int wxQtEventLoopBase::DoRun() bool wxQtEventLoopBase::Pending() const { - QAbstractEventDispatcher *instance = QAbstractEventDispatcher::instance(); - return instance->hasPendingEvents(); + // Note that we are not using any of the QAbstractEventDispatcher::hasPendingEvents() + // or QCoreApplication::hasPendingEvents() functions here to check for pending events, + // as the functions were deprecated in Qt5.3 and removed entirely in Qt6 due to their + // unreliable way to check for pending events according to the Qt developers. + // + // So, in the absence of a replacement for these functions, this function is useless + // under wxQt as it just returns false. + + return false; } bool wxQtEventLoopBase::Dispatch()