wasm: add virtual processWindowSystemEvents()

The QtCore event dispatcher will be used from QtGui
as well. Add virtual function where window system events
processing can be added.

Pick-to: 6.3
Change-Id: Ia6eda9ae18b2e91189ef9f60b6621d19a83313de
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
Morten Johan Sørvig 2021-12-10 11:30:34 +01:00
parent 054b814daa
commit e98f5de6e1
2 changed files with 9 additions and 0 deletions

View File

@ -226,9 +226,15 @@ bool QEventDispatcherWasm::processEvents(QEventLoop::ProcessEventsFlags flags)
hasPendingEvents = qGlobalPostedEventsCount() > 0; hasPendingEvents = qGlobalPostedEventsCount() > 0;
QCoreApplication::sendPostedEvents(); QCoreApplication::sendPostedEvents();
processWindowSystemEvents(flags);
return hasPendingEvents; return hasPendingEvents;
} }
void QEventDispatcherWasm::processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
{
Q_UNUSED(flags);
}
void QEventDispatcherWasm::registerSocketNotifier(QSocketNotifier *notifier) void QEventDispatcherWasm::registerSocketNotifier(QSocketNotifier *notifier)
{ {
if (!emscripten_is_main_runtime_thread()) { if (!emscripten_is_main_runtime_thread()) {

View File

@ -86,6 +86,9 @@ public:
void interrupt() override; void interrupt() override;
void wakeUp() override; void wakeUp() override;
protected:
virtual void processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags);
private: private:
bool isMainThreadEventDispatcher(); bool isMainThreadEventDispatcher();
bool isSecondaryThreadEventDispatcher(); bool isSecondaryThreadEventDispatcher();