summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-11-20 13:03:14 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-20 16:09:28 +0100
commitf1268d137ea7839b320c84314d0c2265f5a629ba (patch)
tree4bfb2a698f819d23c05b242eb08cd59e5ca26df3 /src/gui/kernel/qwindow.cpp
parent54b8c27e03d04c1e5cd35f75d5c0a8111240eb74 (diff)
Allow platform to decide default behavior for show() based on window flags
The ShowIsMaximized and ShowIsFullscreen style hints were not granular enough to build a default behavior from that would be correct for all platforms. The recent Android patch that excluded dialogs from being shown maximized (Ia249e93dbbea1) has now been moved into a platform override in the Android integration plugin, leaving other platforms to the default behavior of using the style-hints. We still special case popup-windows though, as that behavior has been there for a while. Task-number: QTBUG-34969 Change-Id: Id36346d71bfc46171383ffe334592ca0b94e456f Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 4a40dd7e29..2e1d8f9976 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1651,18 +1651,17 @@ QObject *QWindow::focusObject() const
/*!
Shows the window.
- This equivalent to calling showFullScreen() or showNormal(), depending
- on whether the platform defaults to windows being fullscreen or not, and
- whether the window is a popup.
+ This is equivalent to calling showFullScreen(), showMaximized(), or showNormal(),
+ depending on the platform's default behavior for the window type and flags.
- \sa showFullScreen(), showNormal(), hide(), QStyleHints::showIsFullScreen(), flags()
+ \sa showFullScreen(), showMaximized(), showNormal(), hide(), QStyleHints::showIsFullScreen(), flags()
*/
void QWindow::show()
{
- bool isPopup = d_func()->windowFlags & Qt::Popup & ~Qt::Window;
- if (!isPopup && qApp->styleHints()->showIsFullScreen())
+ Qt::WindowState defaultState = QGuiApplicationPrivate::platformIntegration()->defaultWindowState(d_func()->windowFlags);
+ if (defaultState == Qt::WindowFullScreen)
showFullScreen();
- else if (!isPopup && !(d_func()->windowFlags & Qt::Dialog & ~Qt::Window) && QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::ShowIsMaximized).toBool())
+ else if (defaultState == Qt::WindowMaximized)
showMaximized();
else
showNormal();