iOS: raise windows that becomes visible

When a QWindow becomes visible, it should move to front and
be active.

Change-Id: Icab12c6031c0cc8d791e4f8cc49b9c2d5c73100d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
bb10
Richard Moe Gustavsen 2013-01-15 13:22:01 +01:00 committed by Tor Arne Vestbø
parent 355f064ec9
commit e83bed82c1
1 changed files with 9 additions and 1 deletions

View File

@ -264,7 +264,15 @@ void QIOSWindow::setVisible(bool visible)
QPlatformWindow::setVisible(visible);
m_view.hidden = !visible;
if (isQtApplication() && !visible) {
if (!isQtApplication())
return;
// Since iOS doesn't do window management the way a Qt application
// expects, we need to raise and activate windows ourselves:
if (visible) {
raise();
QWindowSystemInterface::handleWindowActivated(window());
} else {
// Activate top-most visible QWindow:
NSArray *subviews = rootViewController().view.subviews;
for (int i = int(subviews.count) - 1; i >= 0; --i) {