class QStyleHints#

The QStyleHints class contains platform specific hints and settings. More

Inheritance diagram of PySide6.QtGui.QStyleHints

Synopsis#

Properties#

Methods#

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

Note

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

property colorSchemeᅟ: Qt.ColorScheme#

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

See also

ColorScheme

Access functions:
property 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 fontSmoothingGammaᅟ: float#

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

Access functions:
property 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 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 keyboardInputIntervalᅟ: int#

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

Access functions:
property 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 mouseDoubleClickIntervalᅟ: int#

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

Access functions:
property mousePressAndHoldIntervalᅟ: int#

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

Access functions:
property 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 passwordMaskCharacterᅟ: QChar#

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

Access functions:
property 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 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 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 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 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 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 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 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 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 tabFocusBehaviorᅟ: 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.

Access functions:
property 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 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 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 wheelScrollLinesᅟ: int#

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

Access functions:
colorScheme()#
Return type:

ColorScheme

Getter of property colorSchemeᅟ .

colorSchemeChanged(colorScheme)#
Parameters:

colorSchemeColorScheme

Notification signal of property colorSchemeᅟ .

cursorFlashTime()#
Return type:

int

Getter of property cursorFlashTimeᅟ .

cursorFlashTimeChanged(cursorFlashTime)#
Parameters:

cursorFlashTime – int

Notification signal of property cursorFlashTimeᅟ .

fontSmoothingGamma()#
Return type:

float

Getter of property fontSmoothingGammaᅟ .

keyboardAutoRepeatRate()#
Return type:

int

Note

This function is deprecated.

Getter of property keyboardAutoRepeatRateᅟ .

keyboardAutoRepeatRateF()#
Return type:

float

Getter of property keyboardAutoRepeatRateFᅟ .

keyboardInputInterval()#
Return type:

int

Getter of property keyboardInputIntervalᅟ .

keyboardInputIntervalChanged(keyboardInputInterval)#
Parameters:

keyboardInputInterval – int

Notification signal of property keyboardInputIntervalᅟ .

mouseDoubleClickDistance()#
Return type:

int

Getter of property mouseDoubleClickDistanceᅟ .

mouseDoubleClickInterval()#
Return type:

int

Getter of property mouseDoubleClickIntervalᅟ .

mouseDoubleClickIntervalChanged(mouseDoubleClickInterval)#
Parameters:

mouseDoubleClickInterval – int

Notification signal of property mouseDoubleClickIntervalᅟ .

mousePressAndHoldInterval()#
Return type:

int

Getter of property mousePressAndHoldIntervalᅟ .

mousePressAndHoldIntervalChanged(mousePressAndHoldInterval)#
Parameters:

mousePressAndHoldInterval – int

Notification signal of property mousePressAndHoldIntervalᅟ .

mouseQuickSelectionThreshold()#
Return type:

int

Getter of property mouseQuickSelectionThresholdᅟ .

mouseQuickSelectionThresholdChanged(threshold)#
Parameters:

threshold – int

Notification signal of property mouseQuickSelectionThresholdᅟ .

passwordMaskCharacter()#
Return type:

QChar

Getter of property passwordMaskCharacterᅟ .

passwordMaskDelay()#
Return type:

int

Getter of property passwordMaskDelayᅟ .

setCursorFlashTime(cursorFlashTime)#
Parameters:

cursorFlashTime – int

setFocusOnTouchRelease()#
Return type:

bool

Getter of property setFocusOnTouchReleaseᅟ .

setKeyboardInputInterval(keyboardInputInterval)#
Parameters:

keyboardInputInterval – int

setMouseDoubleClickInterval(mouseDoubleClickInterval)#
Parameters:

mouseDoubleClickInterval – int

setMousePressAndHoldInterval(mousePressAndHoldInterval)#
Parameters:

mousePressAndHoldInterval – int

setMouseQuickSelectionThreshold(threshold)#
Parameters:

threshold – int

Setter of property mouseQuickSelectionThresholdᅟ .

setShowShortcutsInContextMenus(showShortcutsInContextMenus)#
Parameters:

showShortcutsInContextMenus – bool

Setter of property showShortcutsInContextMenusᅟ .

setStartDragDistance(startDragDistance)#
Parameters:

startDragDistance – int

setStartDragTime(startDragTime)#
Parameters:

startDragTime – int

setTabFocusBehavior(tabFocusBehavior)#
Parameters:

tabFocusBehaviorTabFocusBehavior

setUseHoverEffects(useHoverEffects)#
Parameters:

useHoverEffects – bool

Setter of property useHoverEffectsᅟ .

setWheelScrollLines(scrollLines)#
Parameters:

scrollLines – int

showIsFullScreen()#
Return type:

bool

Getter of property showIsFullScreenᅟ .

showIsMaximized()#
Return type:

bool

Getter of property showIsMaximizedᅟ .

showShortcutsInContextMenus()#
Return type:

bool

Getter of property showShortcutsInContextMenusᅟ .

showShortcutsInContextMenusChanged(arg__1)#
Parameters:

arg__1 – bool

Notification signal of property showShortcutsInContextMenusᅟ .

singleClickActivation()#
Return type:

bool

Getter of property singleClickActivationᅟ .

startDragDistance()#
Return type:

int

Getter of property startDragDistanceᅟ .

startDragDistanceChanged(startDragDistance)#
Parameters:

startDragDistance – int

Notification signal of property startDragDistanceᅟ .

startDragTime()#
Return type:

int

Getter of property startDragTimeᅟ .

startDragTimeChanged(startDragTime)#
Parameters:

startDragTime – int

Notification signal of property startDragTimeᅟ .

startDragVelocity()#
Return type:

int

Getter of property startDragVelocityᅟ .

tabFocusBehavior()#
Return type:

TabFocusBehavior

Getter of property tabFocusBehaviorᅟ .

tabFocusBehaviorChanged(tabFocusBehavior)#
Parameters:

tabFocusBehaviorTabFocusBehavior

Notification signal of property tabFocusBehaviorᅟ .

touchDoubleTapDistance()#
Return type:

int

Getter of property touchDoubleTapDistanceᅟ .

useHoverEffects()#
Return type:

bool

Getter of property useHoverEffectsᅟ .

useHoverEffectsChanged(useHoverEffects)#
Parameters:

useHoverEffects – bool

Notification signal of property useHoverEffectsᅟ .

useRtlExtensions()#
Return type:

bool

Getter of property useRtlExtensionsᅟ .

wheelScrollLines()#
Return type:

int

Getter of property wheelScrollLinesᅟ .

wheelScrollLinesChanged(scrollLines)#
Parameters:

scrollLines – int

Notification signal of property wheelScrollLinesᅟ .