QStyleHints Class

The QStyleHints class contains platform specific hints and settings. More...

Header: #include <QStyleHints>
qmake: QT += gui
Since: Qt 5.0
Inherits: QObject.

Public Functions

int cursorFlashTime() const
qreal fontSmoothingGamma() const
int keyboardAutoRepeatRate() const
int keyboardInputInterval() const
int mouseDoubleClickInterval() const
int mousePressAndHoldInterval() const
QChar passwordMaskCharacter() const
int passwordMaskDelay() const
bool setFocusOnTouchRelease() const
bool showIsFullScreen() const
int startDragDistance() const
int startDragTime() const
int startDragVelocity() const
bool useRtlExtensions() const
  • 31 public functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 2 signals inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QStyleHints class contains platform specific hints and settings.

An object of this class, obtained from QGuiApplication, provides access to certain global user interface parameters of the current platform.

Access is read only; typically the platform itself provides the user a way to tune these parameters.

Access to these parameters are useful when implementing custom user interface components, in that they allow the components to exhibit the same behaviour and feel as other components.

See also QGuiApplication::styleHints() and QPlatformTheme.

Member Function Documentation

int QStyleHints::​cursorFlashTime() const

Returns the text cursor's flash (blink) time in milliseconds.

The flash time is the time used to display, invert and restore the caret display. Usually the text cursor is displayed for half the cursor flash time, then hidden for the same amount of time.

qreal QStyleHints::​fontSmoothingGamma() const

Returns the gamma value used in font smoothing.

int QStyleHints::​keyboardAutoRepeatRate() const

Returns the rate, in events per second, in which additional repeated key presses will automatically be generated if a key is being held down.

int QStyleHints::​keyboardInputInterval() const

Returns the time limit, in milliseconds, that distinguishes a key press from two consecutive key presses.

int QStyleHints::​mouseDoubleClickInterval() const

Returns the time limit in milliseconds that distinguishes a double click from two consecutive mouse clicks.

int QStyleHints::​mousePressAndHoldInterval() const

Returns the time limit in milliseconds that activates a press and hold.

This function was introduced in Qt 5.3.

QChar QStyleHints::​passwordMaskCharacter() const

Returns the character used to mask the characters typed into text input fields in password mode.

int QStyleHints::​passwordMaskDelay() const

Returns the time, in milliseconds, a typed letter is displayed unshrouded in a text input field in password mode.

bool QStyleHints::​setFocusOnTouchRelease() const

Returns true if focus objects (line edits etc) should receive input focus after a touch/mouse release. This is normal behavior on touch platforms. On desktop platforms, the standard is to set focus already on touch/mouse press.

bool QStyleHints::​showIsFullScreen() const

Returns true if the platform defaults to windows being fullscreen, otherwise false.

Note: The platform may still choose to show certain windows non-fullscreen, such as popups or dialogs. This method only returns the default behavior.

See also QWindow::show().

int QStyleHints::​startDragDistance() const

Returns the distance, in pixels, that the mouse must be moved with a button held down before a drag and drop operation will begin.

If you support drag and drop in your application, and want to start a drag and drop operation after the user has moved the cursor a certain distance with a button held down, you should use this property's value as the minimum distance required.

For example, if the mouse position of the click is stored in startPos and the current position (e.g. in the mouse move event) is currentPos, you can find out if a drag should be started with code like this:

if ((startPos - currentPos).manhattanLength() >=
        QApplication::startDragDistance())
    startTheDrag();

See also startDragTime(), QPoint::manhattanLength(), and Drag and Drop.

int QStyleHints::​startDragTime() const

Returns the time, in milliseconds, that a mouse button must be held down before a drag and drop operation will begin.

If you support drag and drop in your application, and want to start a drag and drop operation after the user has held down a mouse button for a certain amount of time, you should use this property's value as the delay.

See also startDragDistance() and Drag and Drop.

int QStyleHints::​startDragVelocity() const

Returns the limit for the velocity, in pixels per second, that the mouse may be moved, with a button held down, for a drag and drop operation to begin. A value of 0 means there is no such limit.

See also startDragDistance() and Drag and Drop.

bool QStyleHints::​useRtlExtensions() const

Returns true if right-to-left writing direction is enabled, otherwise false.

© 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.