path: root/src/corelib/kernel/qeventdispatcher_winrt.cpp
diff options
authorOliver Wolff <>2015-05-26 14:03:11 +0200
committerOliver Wolff <>2015-05-26 13:03:47 +0000
commita42330dc12bf7ee920e5c3c5a230e4fccae727bc (patch)
treee11eb1bb4d0c1d9c0c346ff730a9f0768ad3b1c3 /src/corelib/kernel/qeventdispatcher_winrt.cpp
parentad9698713f91a2e706fcd391f9806057649632ff (diff)
winrt: Fixed timer handling in case where additional user events occur
When timers are used in connection with widgets, it is possible that additional events occur (e.g. deferred deletions). If these happen, the event dispatcher also has to handle timers after handling these events as timer events might not be handled at all otherwise. So instead of returning early, we check whether timer events happened and might return afterwards. Task-number: QTBUG-46299 Change-Id: I3ef0fb23b3ae9a1e13e42497bcfb0976cf4e1b91 Reviewed-by: Andrew Knight <>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_winrt.cpp')
1 files changed, 6 insertions, 3 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_winrt.cpp b/src/corelib/kernel/qeventdispatcher_winrt.cpp
index b5cfccd649..1509996199 100644
--- a/src/corelib/kernel/qeventdispatcher_winrt.cpp
+++ b/src/corelib/kernel/qeventdispatcher_winrt.cpp
@@ -203,9 +203,9 @@ bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
- // Dispatch accumulated user events
- if (sendPostedEvents(flags))
- return true;
+ // Additional user events have to be handled before timer events, but the function may not
+ // return yet.
+ const bool userEventsSent = sendPostedEvents(flags);
emit aboutToBlock();
const QVector<HANDLE> timerHandles = d->timerIdToHandle.values().toVector();
@@ -228,6 +228,9 @@ bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
return true;
emit awake();
+ if (userEventsSent)
+ return true;
} while (flags & QEventLoop::WaitForMoreEvents);
return false;