Add QWindowPrivate::topLevelWindow() helper function
Might be useful to expose to QWindow in 5.3, but for now it's private so it can be used by platform plugins. Change-Id: Iad96d7e249a7b85695668f8d7e8918164ec67442 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This commit is contained in:
parent
848c5d01e2
commit
18b7015e86
@ -2147,6 +2147,26 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed()
|
||||
|
||||
}
|
||||
|
||||
QWindow *QWindowPrivate::topLevelWindow() const
|
||||
{
|
||||
Q_Q(const QWindow);
|
||||
|
||||
QWindow *window = const_cast<QWindow *>(q);
|
||||
|
||||
while (window) {
|
||||
QWindow *parent = window->parent();
|
||||
if (!parent)
|
||||
parent = window->transientParent();
|
||||
|
||||
if (!parent)
|
||||
break;
|
||||
|
||||
window = parent;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
/*!
|
||||
Creates a local representation of a window created by another process or by
|
||||
using native libraries below Qt.
|
||||
|
@ -122,6 +122,8 @@ public:
|
||||
return offset;
|
||||
}
|
||||
|
||||
QWindow *topLevelWindow() const;
|
||||
|
||||
virtual QWindow *eventReceiver() { Q_Q(QWindow); return q; }
|
||||
|
||||
void updateVisibility();
|
||||
|
@ -44,6 +44,9 @@
|
||||
#include <QtGui/QGuiApplication>
|
||||
#include <QtGui/QWindow>
|
||||
#include <QtGui/QScreen>
|
||||
|
||||
#include <QtGui/private/qwindow_p.h>
|
||||
|
||||
#include "qiosscreen.h"
|
||||
#include "qiosglobal.h"
|
||||
#include "qioswindow.h"
|
||||
@ -105,11 +108,10 @@
|
||||
if (hiddenFromPlist)
|
||||
return YES;
|
||||
QWindow *focusWindow = QGuiApplication::focusWindow();
|
||||
if (!focusWindow || !focusWindow->handle())
|
||||
if (!focusWindow)
|
||||
return [UIApplication sharedApplication].statusBarHidden;
|
||||
|
||||
QWindow *topLevel = static_cast<QIOSWindow *>(focusWindow->handle())->topLevelWindow();
|
||||
return topLevel->windowState() == Qt::WindowFullScreen;
|
||||
return qt_window_private(focusWindow)->topLevelWindow()->windowState() == Qt::WindowFullScreen;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -87,8 +87,6 @@ public:
|
||||
|
||||
WId winId() const { return WId(m_view); };
|
||||
|
||||
QWindow *topLevelWindow() const;
|
||||
|
||||
private:
|
||||
void applyGeometry(const QRect &rect);
|
||||
|
||||
|
@ -636,23 +636,6 @@ void QIOSWindow::setParent(const QPlatformWindow *parentWindow)
|
||||
}
|
||||
}
|
||||
|
||||
QWindow *QIOSWindow::topLevelWindow() const
|
||||
{
|
||||
QWindow *window = this->window();
|
||||
while (window) {
|
||||
QWindow *parent = window->parent();
|
||||
if (!parent)
|
||||
parent = window->transientParent();
|
||||
|
||||
if (!parent)
|
||||
break;
|
||||
|
||||
window = parent;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
void QIOSWindow::requestActivateWindow()
|
||||
{
|
||||
// Note that several windows can be active at the same time if they exist in the same
|
||||
|
Loading…
Reference in New Issue
Block a user