wxQt: Make wxEventLoop::Pending() return false unconditionally and document that

Because implementing this function reliably in wxQt is difficult, if not possible.
This commit is contained in:
ali kettab
2025-03-12 09:11:04 +01:00
committed by AliKet
parent acd7d708db
commit 1284b2c427
2 changed files with 11 additions and 2 deletions
+2
View File
@@ -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;
+9 -2
View File
@@ -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()