diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2012-11-07 19:48:38 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-02-27 23:55:39 +0100 |
commit | 6bbe89e2b858564493468c7c5bd9c978c374751a (patch) | |
tree | b8d65dacb1fada96d6e5142239887040a159c61e | |
parent | 0dbee6a5e1e3945dab404f8784df24a9260f0d52 (diff) |
iOS: support stand-alone qApp->processEvents calls
Rough implementation to support stand-alone processEvent calls. We
probably need to revisit this code to fix corner-cases later on.
Change-Id: I72d5639dab599b4d0017aaa52b922f4185a50337
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
-rw-r--r-- | src/plugins/platforms/ios/qioseventdispatcher.mm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm index 4268b02b6d..252e375a54 100644 --- a/src/plugins/platforms/ios/qioseventdispatcher.mm +++ b/src/plugins/platforms/ios/qioseventdispatcher.mm @@ -189,6 +189,7 @@ QIOSEventDispatcher::~QIOSEventDispatcher() bool QIOSEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags) { m_interrupted = false; + bool eventsProcessed = false; UIApplication *uiApplication = [UIApplication sharedApplication]; bool excludeUserEvents = flags & QEventLoop::ExcludeUserInputEvents; @@ -207,10 +208,13 @@ bool QIOSEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags) NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; while ([runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]] && !m_interrupted); } + eventsProcessed = true; } else { - // todo: manual processEvents... + if (!(flags & QEventLoop::WaitForMoreEvents)) + wakeUp(); + eventsProcessed = [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; } - return false; + return eventsProcessed; } bool QIOSEventDispatcher::hasPendingEvents() @@ -313,6 +317,7 @@ void QIOSEventDispatcher::wakeUp() void QIOSEventDispatcher::interrupt() { + wakeUp(); m_interrupted = true; } |