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>
bb10
Richard Moe Gustavsen 2013-01-02 11:03:59 +01:00 committed by Tor Arne Vestbø
parent 847ac6008c
commit 16e8eca362
1 changed files with 5 additions and 0 deletions

View File

@ -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];
}