iOS: Handle statusbar changes to child windows

Going through the platform window failed when the parent wasn't created
yet. We can still get the window state of an yet-to-be-created top level
window.

Change-Id: Iaa61ddc50df037ac0bd2fd0884884c2bfce1dd9a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
bb10
Tor Arne Vestbø 2013-11-28 13:09:44 +01:00 committed by The Qt Project
parent 04ccc2b255
commit 996d78d4c9
3 changed files with 6 additions and 6 deletions

View File

@ -102,11 +102,11 @@
- (BOOL)prefersStatusBarHidden
{
QWindow *focusWindow = QGuiApplication::focusWindow();
if (!focusWindow)
if (!focusWindow || !focusWindow->handle())
return [UIApplication sharedApplication].statusBarHidden;
QIOSWindow *topLevel = static_cast<QIOSWindow *>(focusWindow->handle())->topLevelWindow();
return topLevel->window()->windowState() == Qt::WindowFullScreen;
QWindow *topLevel = static_cast<QIOSWindow *>(focusWindow->handle())->topLevelWindow();
return topLevel->windowState() == Qt::WindowFullScreen;
}
@end

View File

@ -85,7 +85,7 @@ public:
WId winId() const { return WId(m_view); };
QIOSWindow *topLevelWindow() const;
QWindow *topLevelWindow() const;
private:
void applyGeometry(const QRect &rect);

View File

@ -622,7 +622,7 @@ void QIOSWindow::setParent(const QPlatformWindow *parentWindow)
}
}
QIOSWindow *QIOSWindow::topLevelWindow() const
QWindow *QIOSWindow::topLevelWindow() const
{
QWindow *window = this->window();
while (window) {
@ -636,7 +636,7 @@ QIOSWindow *QIOSWindow::topLevelWindow() const
window = parent;
}
return static_cast<QIOSWindow *>(window->handle());
return window;
}
void QIOSWindow::requestActivateWindow()