Add QStyleHints::showIsMaximized().

Expose QPlatformIntegration::ShowIsMaximized similarly to
QPlatformIntegration::ShowIsFullScreen.

This allows for applications to adapt their UI to mobile/desktop
accordingly.

Change-Id: Ic14d16fde11d7d2740b2f4092ae12e88a2f522fd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
bb10
Friedemann Kleint 2015-11-27 10:58:55 +01:00
parent 891c98ebd6
commit 9744ca1085
2 changed files with 19 additions and 1 deletions

View File

@ -305,13 +305,29 @@ int QStyleHints::cursorFlashTime() const
\note The platform may still choose to show certain windows non-fullscreen,
such as popups or dialogs. This property only reports the default behavior.
\sa QWindow::show()
\sa QWindow::show(), showIsMaximized()
*/
bool QStyleHints::showIsFullScreen() const
{
return hint(QPlatformIntegration::ShowIsFullScreen).toBool();
}
/*!
\property QStyleHints::showIsMaximized
\brief \c true if the platform defaults to windows being maximized,
otherwise \c false.
\note The platform may still choose to show certain windows non-maximized,
such as popups or dialogs. This property only reports the default behavior.
\sa QWindow::show(), showIsFullScreen()
\since 5.6
*/
bool QStyleHints::showIsMaximized() const
{
return hint(QPlatformIntegration::ShowIsMaximized).toBool();
}
/*!
\property QStyleHints::passwordMaskDelay
\brief the time, in milliseconds, a typed letter is displayed unshrouded

View File

@ -56,6 +56,7 @@ class Q_GUI_EXPORT QStyleHints : public QObject
Q_PROPERTY(int passwordMaskDelay READ passwordMaskDelay STORED false CONSTANT FINAL)
Q_PROPERTY(bool setFocusOnTouchRelease READ setFocusOnTouchRelease STORED false CONSTANT FINAL)
Q_PROPERTY(bool showIsFullScreen READ showIsFullScreen STORED false CONSTANT FINAL)
Q_PROPERTY(bool showIsMaximized READ showIsMaximized STORED false CONSTANT FINAL)
Q_PROPERTY(int startDragDistance READ startDragDistance NOTIFY startDragDistanceChanged FINAL)
Q_PROPERTY(int startDragTime READ startDragTime NOTIFY startDragTimeChanged FINAL)
Q_PROPERTY(int startDragVelocity READ startDragVelocity STORED false CONSTANT FINAL)
@ -78,6 +79,7 @@ public:
void setCursorFlashTime(int cursorFlashTime);
int cursorFlashTime() const;
bool showIsFullScreen() const;
bool showIsMaximized() const;
int passwordMaskDelay() const;
QChar passwordMaskCharacter() const;
qreal fontSmoothingGamma() const;