QStyleHints Class | Qt GUI 5.6

Qt 5.6 | Qt GUI | C++ Classes | QStyleHints

Qt 5.6.2 Reference Documentation

# QStyleHints Class

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

Header: | #include <QStyleHints>
qmake: | QT += gui
Since: | Qt 5.0

- List of all members, including inherited members

## Properties

cursorFlashTime : const int fontSmoothingGamma : const qreal keyboardAutoRepeatRate : const int keyboardInputInterval : const int mouseDoubleClickInterval : const int mousePressAndHoldInterval : const int passwordMaskCharacter : const QChar passwordMaskDelay : const int setFocusOnTouchRelease : const bool | showIsFullScreen : const bool showIsMaximized : const bool singleClickActivation : const bool startDragDistance : const int startDragTime : const int startDragVelocity : const int tabFocusBehavior : const Qt::TabFocusBehavior useRtlExtensions : const bool

## 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
bool | showIsMaximized() const
bool | singleClickActivation() const
int | startDragDistance() const
int | startDragTime() const
int | startDragVelocity() const
Qt::TabFocusBehavior | tabFocusBehavior() const
bool | useRtlExtensions() const

## Signals

void | cursorFlashTimeChanged(int cursorFlashTime)
void | keyboardInputIntervalChanged(int keyboardInputInterval)
void | mouseDoubleClickIntervalChanged(int mouseDoubleClickInterval)
void | startDragDistanceChanged(int startDragDistance)
void | startDragTimeChanged(int startDragTime)

## 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().

## Property Documentation

### cursorFlashTime : const int

This property holds 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.

Access functions:

int | cursorFlashTime() const

Notifier signal:

void | cursorFlashTimeChanged(int cursorFlashTime)

### fontSmoothingGamma : const qreal

This property holds the gamma value used in font smoothing.

Access functions:

qreal | fontSmoothingGamma() const

### keyboardAutoRepeatRate : const int

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

Access functions:

int | keyboardAutoRepeatRate() const

### keyboardInputInterval : const int

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

Access functions:

int | keyboardInputInterval() const

Notifier signal:

void | keyboardInputIntervalChanged(int keyboardInputInterval)

### mouseDoubleClickInterval : const int

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

Access functions:

int | mouseDoubleClickInterval() const

Notifier signal:

void | mouseDoubleClickIntervalChanged(int mouseDoubleClickInterval)

### mousePressAndHoldInterval : const int

This property holds the time limit in milliseconds that activates a press and hold.

This property was introduced in Qt 5.3.

Access functions:

int | mousePressAndHoldInterval() const

### passwordMaskCharacter : const QChar

This property holds the character used to mask the characters typed into text input fields in password mode.

Access functions:

QChar | passwordMaskCharacter() const

### passwordMaskDelay : const int

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

Access functions:

int | passwordMaskDelay() const

### setFocusOnTouchRelease : const bool

This property holds 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.

Access functions:

bool | setFocusOnTouchRelease() const

### showIsFullScreen : const bool

This property holds if the platform defaults to windows being fullscreen, otherwise .

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

Access functions:

bool | showIsFullScreen() const

See also QWindow::show() and showIsMaximized().

### showIsMaximized : const bool

This property holds if the platform defaults to windows being maximized, otherwise .

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

This property was introduced in Qt 5.6.

Access functions:

bool | showIsMaximized() const

See also QWindow::show() and showIsFullScreen().

### singleClickActivation : const bool

This property holds if items should be activated by single click, false if they should be activated by double click instead.

This property was introduced in Qt 5.5.

Access functions:

bool | singleClickActivation() const

### startDragDistance : const int

This property holds 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();

Access functions:

int | startDragDistance() const

Notifier signal:

void | startDragDistanceChanged(int startDragDistance)

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

### startDragTime : const int

This property holds 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.

Access functions:

int | startDragTime() const

Notifier signal:

void | startDragTimeChanged(int startDragTime)

See also startDragDistance and Drag and Drop.

### startDragVelocity : const int

This property holds 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.

Access functions:

int | startDragVelocity() const

See also startDragDistance and Drag and Drop.

### tabFocusBehavior : const Qt::TabFocusBehavior

This property holds the focus behavior on press of the tab key.

Note: Do not bind this value in QML because the change notifier signal is not implemented yet.

This property was introduced in Qt 5.5.

Access functions:

Qt::TabFocusBehavior | tabFocusBehavior() const

### useRtlExtensions : const bool

This property holds if right-to-left writing direction is enabled, otherwise .

Access functions:

bool | useRtlExtensions() const