From 63a46568bf927934027259486110f82f896105f7 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 30 Apr 2015 14:58:15 +0200 Subject: ios: don't autoactivate if _q_showWithoutActivating MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Widgets can have the attribute Qt::WA_ShowWithoutActivating set, which is forwarded to QWindow as a property (_q_showWithoutActivating). Both The cocoa plugin and the windows plugin check for this property before activating a window upon setVisible, so lets do the same for the iOS plugin. Note that this is not the same as shouldAutoActivate, since the window should gain focus like normal if the user taps on it. Change-Id: Ie6c95d4044906d97f0a03d27009a23d462c6ca34 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qioswindow.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index daeebee3a1..80fba00ffb 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -119,7 +119,8 @@ void QIOSWindow::setVisible(bool visible) } if (visible && shouldAutoActivateWindow()) { - requestActivateWindow(); + if (!window()->property("_q_showWithoutActivating").toBool()) + requestActivateWindow(); } else if (!visible && [m_view isActiveWindow]) { // Our window was active/focus window but now hidden, so relinquish // focus to the next possible window in the stack. -- cgit v1.2.3