path: root/src/plugins/platforms
diff options
authorRichard Moe Gustavsen <>2015-11-16 12:07:15 +0100
committerRichard Moe Gustavsen <>2015-11-23 08:04:32 +0000
commitfe4ab7edce3863a23d5871634d93f0b855aa93ac (patch)
treeb19f9d2232fa3a3ce1dbffbda9ef7e99bbd9467b /src/plugins/platforms
parentbc7d0da741d1bc2ab2d36227d40d255c692a6fa5 (diff)
iOS: always flush spontaneous key press events
When we changed sending key events through QPA instead of directly to the focus object, we only flushed from deleteBackward (06be9f026). The reason was to avoid unnecessary flushes, as this in general can be a source to recursion problems. It turns out that this is also needed when sending Qt::Key_Return. The reason is that we sometimes resign first responder when the return key is pressed, which will also change the focus object in Qt. And without flushing the key event first, it will be processed after the change and therefore end up at the wrong object. It seems like the most sensible thing is to always flush upon receiving spontaneous key/text events from iOS, which is also how it was before. Task-number: QTBUG-49021 Change-Id: I44885a11275dee5039ef6a8abbcbdadc092695e7 Reviewed-by: Tor Arne Vestbø <>
Diffstat (limited to 'src/plugins/platforms')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/ b/src/plugins/platforms/ios/
index c9120e848c..f3ea68cdc4 100644
--- a/src/plugins/platforms/ios/
+++ b/src/plugins/platforms/ios/
@@ -329,6 +329,7 @@
QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyPress, key, modifiers);
QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyRelease, key, modifiers);
+ QWindowSystemInterface::flushWindowSystemEvents();
@@ -875,7 +876,6 @@
// UITextInput selects the text to be deleted before calling this method. To avoid
// drawing the selection, we flush after posting the key press/release.
[self sendKeyPressRelease:Qt::Key_Backspace modifiers:Qt::NoModifier];
- QWindowSystemInterface::flushWindowSystemEvents();