diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-11-20 13:03:14 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-20 16:09:28 +0100 |
commit | f1268d137ea7839b320c84314d0c2265f5a629ba (patch) | |
tree | 4bfb2a698f819d23c05b242eb08cd59e5ca26df3 /src/gui/kernel/qplatformintegration.cpp | |
parent | 54b8c27e03d04c1e5cd35f75d5c0a8111240eb74 (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/qplatformintegration.cpp')
-rw-r--r-- | src/gui/kernel/qplatformintegration.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 08a3b63ee4..26aaf931b3 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -364,6 +364,20 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const return 0; } +Qt::WindowState QPlatformIntegration::defaultWindowState(Qt::WindowFlags flags) const +{ + // Leave popup-windows as is + if (flags & Qt::Popup & ~Qt::Window) + return Qt::WindowNoState; + + if (styleHint(QPlatformIntegration::ShowIsFullScreen).toBool()) + return Qt::WindowFullScreen; + else if (styleHint(QPlatformIntegration::ShowIsMaximized).toBool()) + return Qt::WindowMaximized; + + return Qt::WindowNoState; +} + Qt::KeyboardModifiers QPlatformIntegration::queryKeyboardModifiers() const { return QGuiApplication::keyboardModifiers(); |