QStyleHints#

The QStyleHints class contains platform specific hints and settings. More

Inheritance diagram of PySide6.QtGui.QStyleHints

Synopsis#

Properties#

  • colorScheme - The color scheme of the platform theme

  • cursorFlashTime - The text cursor’s flash (blink) time in milliseconds

  • fontSmoothingGamma - The gamma value used in font smoothing

  • keyboardAutoRepeatRate - The rate, in events per second, in which additional repeated key presses will automatically be generated if a key is being held down. Use keyboardAutoRepeatRateF() instead

  • keyboardAutoRepeatRateF - The rate, in events per second, in which additional repeated key presses will automatically be generated if a key is being held down

  • keyboardInputInterval - The time limit, in milliseconds, that distinguishes a key press from two consecutive key presses

  • mouseDoubleClickDistance - 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

  • mouseDoubleClickInterval - The time limit in milliseconds that distinguishes a double click from two consecutive mouse clicks

  • mousePressAndHoldInterval - The time limit in milliseconds that activates a press and hold

  • mouseQuickSelectionThreshold - Quick selection mouse threshold in QLineEdit

  • passwordMaskCharacter - The character used to mask the characters typed into text input fields in password mode

  • passwordMaskDelay - The time, in milliseconds, a typed letter is displayed unshrouded in a text input field in password mode

  • setFocusOnTouchRelease - The event that should set input focus on focus objects

  • showIsFullScreen - Whether the platform defaults to fullscreen windows

  • showIsMaximized - Whether the platform defaults to maximized windows

  • showShortcutsInContextMenus - True if the platform normally shows shortcut key sequences in context menus, otherwise false

  • singleClickActivation - Whether items are activated by single or double click

  • startDragDistance - The distance, in pixels, that the mouse must be moved with a button held down before a drag and drop operation will begin

  • startDragTime - The time, in milliseconds, that a mouse button must be held down before a drag and drop operation will begin

  • startDragVelocity - 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

  • tabFocusBehavior - Focus behavior on press of the tab key

  • touchDoubleTapDistance - The maximum distance, in pixels, that a finger can be moved between two consecutive taps and still have it detected as a double-tap

  • useHoverEffects - Whether UI elements use hover effects

  • useRtlExtensions - The writing direction

  • wheelScrollLines - Number of lines to scroll by default for each wheel click

Functions#

Signals#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

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

Access to most settings is read only. The platform itself usually provides the user with ways to tune these parameters. Authors of custom user interface components should read relevant settings to allow the components to exhibit the same behavior and feel as other components.

See also

styleHints()

class PySide6.QtGui.QStyleHints#

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property PᅟySide6.QtGui.QStyleHints.colorScheme: ColorScheme#

This property holds the color scheme of the platform theme..

See also

ColorScheme

Access functions:
property PᅟySide6.QtGui.QStyleHints.cursorFlashTime: 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:
property PᅟySide6.QtGui.QStyleHints.fontSmoothingGamma: float#

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

Access functions:
property PᅟySide6.QtGui.QStyleHints.keyboardAutoRepeatRate: 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. Use keyboardAutoRepeatRateF() instead.

Access functions:
property PᅟySide6.QtGui.QStyleHints.keyboardAutoRepeatRateF: float#

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:
property PᅟySide6.QtGui.QStyleHints.keyboardInputInterval: int#

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

Access functions:
property PᅟySide6.QtGui.QStyleHints.mouseDoubleClickDistance: 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.

Access functions:
property PᅟySide6.QtGui.QStyleHints.mouseDoubleClickInterval: int#

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

Access functions:
property PᅟySide6.QtGui.QStyleHints.mousePressAndHoldInterval: int#

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

Access functions:
property PᅟySide6.QtGui.QStyleHints.mouseQuickSelectionThreshold: 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.

Access functions:
property PᅟySide6.QtGui.QStyleHints.passwordMaskCharacter: QChar#

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

Access functions:
property PᅟySide6.QtGui.QStyleHints.passwordMaskDelay: int#

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

Access functions:
property PᅟySide6.QtGui.QStyleHints.setFocusOnTouchRelease: 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.

Access functions:
property PᅟySide6.QtGui.QStyleHints.showIsFullScreen: 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.

Access functions:
property PᅟySide6.QtGui.QStyleHints.showIsMaximized: 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.

Access functions:
property PᅟySide6.QtGui.QStyleHints.showShortcutsInContextMenus: bool#

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

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

See also

AA_DontShowShortcutsInContextMenus

Access functions:
property PᅟySide6.QtGui.QStyleHints.singleClickActivation: 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.

Access functions:
property PᅟySide6.QtGui.QStyleHints.startDragDistance: int#

Warning

This section contains snippets that were automatically translated from C++ to Python and may contain errors.

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:
property PᅟySide6.QtGui.QStyleHints.startDragTime: 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:
property PᅟySide6.QtGui.QStyleHints.startDragVelocity: 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:
property PᅟySide6.QtGui.QStyleHints.tabFocusBehavior: 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.

Access functions:
property PᅟySide6.QtGui.QStyleHints.touchDoubleTapDistance: 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.

Access functions:
property PᅟySide6.QtGui.QStyleHints.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.

Access functions:
property PᅟySide6.QtGui.QStyleHints.useRtlExtensions: bool#

This property holds the writing direction..

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

Access functions:
property PᅟySide6.QtGui.QStyleHints.wheelScrollLines: int#

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

Access functions:
PySide6.QtGui.QStyleHints.colorScheme()#
Return type:

ColorScheme

Getter of property colorScheme .

PySide6.QtGui.QStyleHints.colorSchemeChanged(colorScheme)#
Parameters:

colorSchemeColorScheme

Notification signal of property colorScheme .

PySide6.QtGui.QStyleHints.cursorFlashTime()#
Return type:

int

Getter of property cursorFlashTime .

PySide6.QtGui.QStyleHints.cursorFlashTimeChanged(cursorFlashTime)#
Parameters:

cursorFlashTime – int

Notification signal of property cursorFlashTime .

PySide6.QtGui.QStyleHints.fontSmoothingGamma()#
Return type:

float

Getter of property fontSmoothingGamma .

PySide6.QtGui.QStyleHints.keyboardAutoRepeatRate()#
Return type:

int

Note

This function is deprecated.

Getter of property keyboardAutoRepeatRate .

PySide6.QtGui.QStyleHints.keyboardAutoRepeatRateF()#
Return type:

float

Getter of property keyboardAutoRepeatRateF .

PySide6.QtGui.QStyleHints.keyboardInputInterval()#
Return type:

int

Getter of property keyboardInputInterval .

PySide6.QtGui.QStyleHints.keyboardInputIntervalChanged(keyboardInputInterval)#
Parameters:

keyboardInputInterval – int

Notification signal of property keyboardInputInterval .

PySide6.QtGui.QStyleHints.mouseDoubleClickDistance()#
Return type:

int

Getter of property mouseDoubleClickDistance .

PySide6.QtGui.QStyleHints.mouseDoubleClickInterval()#
Return type:

int

Getter of property mouseDoubleClickInterval .

PySide6.QtGui.QStyleHints.mouseDoubleClickIntervalChanged(mouseDoubleClickInterval)#
Parameters:

mouseDoubleClickInterval – int

Notification signal of property mouseDoubleClickInterval .

PySide6.QtGui.QStyleHints.mousePressAndHoldInterval()#
Return type:

int

Getter of property mousePressAndHoldInterval .

PySide6.QtGui.QStyleHints.mousePressAndHoldIntervalChanged(mousePressAndHoldInterval)#
Parameters:

mousePressAndHoldInterval – int

Notification signal of property mousePressAndHoldInterval .

PySide6.QtGui.QStyleHints.mouseQuickSelectionThreshold()#
Return type:

int

Getter of property mouseQuickSelectionThreshold .

PySide6.QtGui.QStyleHints.mouseQuickSelectionThresholdChanged(threshold)#
Parameters:

threshold – int

Notification signal of property mouseQuickSelectionThreshold .

PySide6.QtGui.QStyleHints.passwordMaskCharacter()#
Return type:

QChar

Getter of property passwordMaskCharacter .

PySide6.QtGui.QStyleHints.passwordMaskDelay()#
Return type:

int

Getter of property passwordMaskDelay .

PySide6.QtGui.QStyleHints.setCursorFlashTime(cursorFlashTime)#
Parameters:

cursorFlashTime – int

PySide6.QtGui.QStyleHints.setFocusOnTouchRelease()#
Return type:

bool

Getter of property setFocusOnTouchRelease .

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

Setter of property mouseQuickSelectionThreshold .

PySide6.QtGui.QStyleHints.setShowShortcutsInContextMenus(showShortcutsInContextMenus)#
Parameters:

showShortcutsInContextMenus – bool

Setter of property showShortcutsInContextMenus .

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

Setter of property useHoverEffects .

PySide6.QtGui.QStyleHints.setWheelScrollLines(scrollLines)#
Parameters:

scrollLines – int

PySide6.QtGui.QStyleHints.showIsFullScreen()#
Return type:

bool

Getter of property showIsFullScreen .

PySide6.QtGui.QStyleHints.showIsMaximized()#
Return type:

bool

Getter of property showIsMaximized .

PySide6.QtGui.QStyleHints.showShortcutsInContextMenus()#
Return type:

bool

Getter of property showShortcutsInContextMenus .

PySide6.QtGui.QStyleHints.showShortcutsInContextMenusChanged(arg__1)#
Parameters:

arg__1 – bool

Notification signal of property showShortcutsInContextMenus .

PySide6.QtGui.QStyleHints.singleClickActivation()#
Return type:

bool

Getter of property singleClickActivation .

PySide6.QtGui.QStyleHints.startDragDistance()#
Return type:

int

Getter of property startDragDistance .

PySide6.QtGui.QStyleHints.startDragDistanceChanged(startDragDistance)#
Parameters:

startDragDistance – int

Notification signal of property startDragDistance .

PySide6.QtGui.QStyleHints.startDragTime()#
Return type:

int

Getter of property startDragTime .

PySide6.QtGui.QStyleHints.startDragTimeChanged(startDragTime)#
Parameters:

startDragTime – int

Notification signal of property startDragTime .

PySide6.QtGui.QStyleHints.startDragVelocity()#
Return type:

int

Getter of property startDragVelocity .

PySide6.QtGui.QStyleHints.tabFocusBehavior()#
Return type:

TabFocusBehavior

Getter of property tabFocusBehavior .

PySide6.QtGui.QStyleHints.tabFocusBehaviorChanged(tabFocusBehavior)#
Parameters:

tabFocusBehaviorTabFocusBehavior

Notification signal of property tabFocusBehavior .

PySide6.QtGui.QStyleHints.touchDoubleTapDistance()#
Return type:

int

Getter of property touchDoubleTapDistance .

PySide6.QtGui.QStyleHints.useHoverEffects()#
Return type:

bool

Getter of property useHoverEffects .

PySide6.QtGui.QStyleHints.useHoverEffectsChanged(useHoverEffects)#
Parameters:

useHoverEffects – bool

Notification signal of property useHoverEffects .

PySide6.QtGui.QStyleHints.useRtlExtensions()#
Return type:

bool

Getter of property useRtlExtensions .

PySide6.QtGui.QStyleHints.wheelScrollLines()#
Return type:

int

Getter of property wheelScrollLines .

PySide6.QtGui.QStyleHints.wheelScrollLinesChanged(scrollLines)#
Parameters:

scrollLines – int

Notification signal of property wheelScrollLines .