path: root/src
diff options
authorTor Arne Vestbø <>2015-03-20 11:23:31 +0100
committerTor Arne Vestbø <>2015-03-27 10:24:17 +0000
commit013afc77f0a191ee60d0d2d6b84d35435fdc9c07 (patch)
tree8552b45a74f05ca90b44b24f499d8ec2cb81d178 /src
parenta73cead0e0ffe674d0c873a726d2535ba60d9614 (diff)
Add Qt::WindowFlag to signal that maximizing should cover full screen geometry
Normally when maximizing a window it will cover the available geometry of the screen, as represented by QScreen::availableGeometry(), which typically excludes status/menu bars and application launchers. On some platforms it may still be possible to place windows in the areas of the screen that are outside of the available geometry, but this will result in the window being partially covered by (possibly) transparent system UIs. The new flag allows the user to specify that when maximizing the window it should try to cover as much as possible of the screen geometry (in contrast to going full screen, which would typically hide any system UIs). For iOS this is a common use-case, as the status bar is transparent, and the user-interface guidelines for iOS7 and up recommend taking advantage of the full screen space, while keeping any user-interaction elements still inside the available geometry of the screen. Change-Id: I86d7fc937916d9cae245f7a3f9ae46abd92cdd29 Reviewed-by: Lars Knoll <> Reviewed-by: Eskil Abrahamsen Blomfeldt <>
Diffstat (limited to 'src')
3 files changed, 12 insertions, 1 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 420b8b0430..3a7356d0fe 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -287,6 +287,7 @@ public:
WindowTransparentForInput = 0x00080000,
WindowOverridesSystemGestures = 0x00100000,
WindowDoesNotAcceptFocus = 0x00200000,
+ MaximizeUsingFullscreenGeometryHint = 0x00400000,
CustomizeWindowHint = 0x02000000,
WindowStaysOnBottomHint = 0x04000000,
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index ba3a621751..669bc7a17a 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2159,6 +2159,15 @@
\value WindowDoesNotAcceptFocus Informs the window system that this window should
not receive the input focus.
+ \value MaximizeUsingFullscreenGeometryHint Informs the window system that when
+ maximizing the window it should use as much of the available screen geometry
+ as possible, including areas that may be covered by system UI such as status
+ bars or application launchers. This may result in the window being placed
+ under these system UIs, but does not guarantee it, depending on whether or
+ not the platform supports it. When the flag is enabled the user is responsible
+ for taking QScreen::availableGeometry() into account, so that any UI elements
+ in the application that require user interaction are not covered by system UI.
\value WindowType_Mask A mask for extracting the window type
part of the window flags.
diff --git a/src/plugins/platforms/ios/ b/src/plugins/platforms/ios/
index 95a4c28246..777a3c12c5 100644
--- a/src/plugins/platforms/ios/
+++ b/src/plugins/platforms/ios/
@@ -244,7 +244,8 @@ void QIOSWindow::setWindowState(Qt::WindowState state)
case Qt::WindowMaximized:
- applyGeometry(screen()->availableGeometry());
+ applyGeometry(window()->flags() & Qt::MaximizeUsingFullscreenGeometryHint ?
+ screen()->geometry() : screen()->availableGeometry());
case Qt::WindowFullScreen: