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
parent
04ccc2b255
commit
996d78d4c9
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public:
|
|||
|
||||
WId winId() const { return WId(m_view); };
|
||||
|
||||
QIOSWindow *topLevelWindow() const;
|
||||
QWindow *topLevelWindow() const;
|
||||
|
||||
private:
|
||||
void applyGeometry(const QRect &rect);
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue