QStyleHints

The QStyleHints class contains platform specific hints and settings. More

Inheritance diagram of PySide6.QtGui.QStyleHints

Synopsis

Functions

Signals

Detailed Description

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

styleHints()

class PySide6.QtGui.QStyleHints
PySide6.QtGui.QStyleHints.cursorFlashTime()
Return type

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.

PySide6.QtGui.QStyleHints.cursorFlashTimeChanged(cursorFlashTime)
Parameters

cursorFlashTime – int

PySide6.QtGui.QStyleHints.fontSmoothingGamma()
Return type

float

This property holds the gamma value used in font smoothing..

PySide6.QtGui.QStyleHints.keyboardAutoRepeatRate()
Return type

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..

PySide6.QtGui.QStyleHints.keyboardInputInterval()
Return type

int

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

PySide6.QtGui.QStyleHints.keyboardInputIntervalChanged(keyboardInputInterval)
Parameters

keyboardInputInterval – int

PySide6.QtGui.QStyleHints.mouseDoubleClickDistance()
Return type

int

This property holds the maximum distance, in pixels, that the mouse can be moved between two consecutive mouse clicks and still have it detected as a double-click.

PySide6.QtGui.QStyleHints.mouseDoubleClickInterval()
Return type

int

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

PySide6.QtGui.QStyleHints.mouseDoubleClickIntervalChanged(mouseDoubleClickInterval)
Parameters

mouseDoubleClickInterval – int

PySide6.QtGui.QStyleHints.mousePressAndHoldInterval()
Return type

int

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

PySide6.QtGui.QStyleHints.mousePressAndHoldIntervalChanged(mousePressAndHoldInterval)
Parameters

mousePressAndHoldInterval – int

PySide6.QtGui.QStyleHints.mouseQuickSelectionThreshold()
Return type

int

This property holds Quick selection mouse threshold in QLineEdit ..

This property defines how much the mouse cursor should be moved along the y axis to trigger a quick selection during a normal QLineEdit text selection.

If the property value is less than or equal to 0, the quick selection feature is disabled.

PySide6.QtGui.QStyleHints.mouseQuickSelectionThresholdChanged(threshold)
Parameters

threshold – int

PySide6.QtGui.QStyleHints.passwordMaskCharacter()
Return type

QChar

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

PySide6.QtGui.QStyleHints.passwordMaskDelay()
Return type

int

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

PySide6.QtGui.QStyleHints.setCursorFlashTime(cursorFlashTime)
Parameters

cursorFlashTime – int

PySide6.QtGui.QStyleHints.setFocusOnTouchRelease()
Return type

bool

This property holds the event that should set input focus on focus objects..

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

PySide6.QtGui.QStyleHints.setKeyboardInputInterval(keyboardInputInterval)
Parameters

keyboardInputInterval – int

PySide6.QtGui.QStyleHints.setMouseDoubleClickInterval(mouseDoubleClickInterval)
Parameters

mouseDoubleClickInterval – int

PySide6.QtGui.QStyleHints.setMousePressAndHoldInterval(mousePressAndHoldInterval)
Parameters

mousePressAndHoldInterval – int

PySide6.QtGui.QStyleHints.setMouseQuickSelectionThreshold(threshold)
Parameters

threshold – int

This property holds Quick selection mouse threshold in QLineEdit ..

This property defines how much the mouse cursor should be moved along the y axis to trigger a quick selection during a normal QLineEdit text selection.

If the property value is less than or equal to 0, the quick selection feature is disabled.

PySide6.QtGui.QStyleHints.setShowShortcutsInContextMenus(showShortcutsInContextMenus)
Parameters

showShortcutsInContextMenus – bool

This property holds true if the platform normally shows shortcut key sequences in context menus, otherwise false..

Since Qt 5.13, the function can be used to override the platform default.

PySide6.QtGui.QStyleHints.setStartDragDistance(startDragDistance)
Parameters

startDragDistance – int

PySide6.QtGui.QStyleHints.setStartDragTime(startDragTime)
Parameters

startDragTime – int

PySide6.QtGui.QStyleHints.setTabFocusBehavior(tabFocusBehavior)
Parameters

tabFocusBehaviorTabFocusBehavior

PySide6.QtGui.QStyleHints.setUseHoverEffects(useHoverEffects)
Parameters

useHoverEffects – bool

This property holds whether UI elements use hover effects..

This property is true if UI elements should use hover effects. This is the standard behavior on desktop platforms with a mouse pointer, whereas on touch platforms the overhead of hover event delivery can be avoided.

PySide6.QtGui.QStyleHints.setWheelScrollLines(scrollLines)
Parameters

scrollLines – int

PySide6.QtGui.QStyleHints.showIsFullScreen()
Return type

bool

This property holds whether the platform defaults to fullscreen windows..

This property is 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 property only reports the default behavior.

PySide6.QtGui.QStyleHints.showIsMaximized()
Return type

bool

This property holds whether the platform defaults to maximized windows..

This property is true if the platform defaults to windows being maximized, otherwise 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.

PySide6.QtGui.QStyleHints.showShortcutsInContextMenus()
Return type

bool

This property holds true if the platform normally shows shortcut key sequences in context menus, otherwise false..

Since Qt 5.13, the function can be used to override the platform default.

PySide6.QtGui.QStyleHints.showShortcutsInContextMenusChanged(arg__1)
Parameters

arg__1 – bool

PySide6.QtGui.QStyleHints.singleClickActivation()
Return type

bool

This property holds whether items are activated by single or double click..

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

PySide6.QtGui.QStyleHints.startDragDistance()
Return type

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 __name__ == "__main__":

    QApplication.setDesktopSettingsAware(False)
    app = QApplication([])
    ...
    sys.exit(app.exec())

See also

startDragTime manhattanLength() Drag and Drop

PySide6.QtGui.QStyleHints.startDragDistanceChanged(startDragDistance)
Parameters

startDragDistance – int

PySide6.QtGui.QStyleHints.startDragTime()
Return type

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.

PySide6.QtGui.QStyleHints.startDragTimeChanged(startDragTime)
Parameters

startDragTime – int

PySide6.QtGui.QStyleHints.startDragVelocity()
Return type

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..

PySide6.QtGui.QStyleHints.tabFocusBehavior()
Return type

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.

PySide6.QtGui.QStyleHints.tabFocusBehaviorChanged(tabFocusBehavior)
Parameters

tabFocusBehaviorTabFocusBehavior

PySide6.QtGui.QStyleHints.touchDoubleTapDistance()
Return type

int

This property holds the maximum distance, in pixels, that a finger can be moved between two consecutive taps and still have it detected as a double-tap.

PySide6.QtGui.QStyleHints.useHoverEffects()
Return type

bool

This property holds whether UI elements use hover effects..

This property is true if UI elements should use hover effects. This is the standard behavior on desktop platforms with a mouse pointer, whereas on touch platforms the overhead of hover event delivery can be avoided.

PySide6.QtGui.QStyleHints.useHoverEffectsChanged(useHoverEffects)
Parameters

useHoverEffects – bool

PySide6.QtGui.QStyleHints.useRtlExtensions()
Return type

bool

This property holds the writing direction..

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

PySide6.QtGui.QStyleHints.wheelScrollLines()
Return type

int

This property holds Number of lines to scroll by default for each wheel click..

PySide6.QtGui.QStyleHints.wheelScrollLinesChanged(scrollLines)
Parameters

scrollLines – int