summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2013-01-02 11:03:59 +0100
committerTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-02-27 23:56:03 +0100
commit16e8eca3621b89730f13e07c258fb8a4ae68a1ce (patch)
treec123b4f795a645b0816acf9b0a3e99d5b44507ec
parent847ac6008ca02a9acb1f4bd2159c6e4cfa332961 (diff)
iOS: transfer focus to the window touched
Since our QWindows are UIViews rather than UIWindows, we need to implement window activation manually. This patch will ensure that the window touched by the user also gets keyboard focus. Change-Id: I9390c5c8e50a4b066cd1320a2a044e02f2a9f75d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
-rw-r--r--src/plugins/platforms/ios/qioswindow.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm
index 88debb7c33..c7c27c08ce 100644
--- a/src/plugins/platforms/ios/qioswindow.mm
+++ b/src/plugins/platforms/ios/qioswindow.mm
@@ -151,6 +151,11 @@
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
+ // Transfer focus to the touched window:
+ QWindow *window = m_qioswindow->window();
+ if (window != QGuiApplication::focusWindow())
+ QWindowSystemInterface::handleWindowActivated(window);
+
[self sendMouseEventForTouches:touches withEvent:event fakeButtons:Qt::LeftButton];
}