QStyleHints

The QStyleHints class contains platform specific hints and settings. More

Inheritance diagram of PySide2.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 PySide2.QtGui.QStyleHints
PySide2.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.

PySide2.QtGui.QStyleHints.cursorFlashTimeChanged(cursorFlashTime)
Parameters

cursorFlashTime – int

PySide2.QtGui.QStyleHints.fontSmoothingGamma()
Return type

float

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

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

PySide2.QtGui.QStyleHints.keyboardInputInterval()
Return type

int

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

PySide2.QtGui.QStyleHints.keyboardInputIntervalChanged(keyboardInputInterval)
Parameters

keyboardInputInterval – int

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

PySide2.QtGui.QStyleHints.mouseDoubleClickInterval()
Return type

int

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

PySide2.QtGui.QStyleHints.mouseDoubleClickIntervalChanged(mouseDoubleClickInterval)
Parameters

mouseDoubleClickInterval – int

PySide2.QtGui.QStyleHints.mousePressAndHoldInterval()
Return type

int

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

PySide2.QtGui.QStyleHints.mousePressAndHoldIntervalChanged(mousePressAndHoldInterval)
Parameters

mousePressAndHoldInterval – int

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

PySide2.QtGui.QStyleHints.mouseQuickSelectionThresholdChanged(threshold)
Parameters

threshold – int

PySide2.QtGui.QStyleHints.passwordMaskCharacter()
Return type

QChar

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

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

PySide2.QtGui.QStyleHints.setCursorFlashTime(cursorFlashTime)
Parameters

cursorFlashTime – int

Sets the cursorFlashTime .

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

PySide2.QtGui.QStyleHints.setKeyboardInputInterval(keyboardInputInterval)
Parameters

keyboardInputInterval – int

Sets the keyboardInputInterval .

PySide2.QtGui.QStyleHints.setMouseDoubleClickInterval(mouseDoubleClickInterval)
Parameters

mouseDoubleClickInterval – int

Sets the mouseDoubleClickInterval .

PySide2.QtGui.QStyleHints.setMousePressAndHoldInterval(mousePressAndHoldInterval)
Parameters

mousePressAndHoldInterval – int

Sets the mousePressAndHoldInterval .

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

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

PySide2.QtGui.QStyleHints.setStartDragDistance(startDragDistance)
Parameters

startDragDistance – int

Sets the startDragDistance .

PySide2.QtGui.QStyleHints.setStartDragTime(startDragTime)
Parameters

startDragTime – int

Sets the startDragDragTime .

See also

startDragTime()

PySide2.QtGui.QStyleHints.setTabFocusBehavior(tabFocusBehavior)
Parameters

tabFocusBehaviorTabFocusBehavior

Sets the tabFocusBehavior .

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

PySide2.QtGui.QStyleHints.setWheelScrollLines(scrollLines)
Parameters

scrollLines – int

Sets the wheelScrollLines .

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

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

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

PySide2.QtGui.QStyleHints.showShortcutsInContextMenusChanged(arg__1)
Parameters

arg__1 – bool

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

PySide2.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.argv)
    # ...
    return app.exec_()

See also

startDragTime manhattanLength() Drag and Drop

PySide2.QtGui.QStyleHints.startDragDistanceChanged(startDragDistance)
Parameters

startDragDistance – int

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

PySide2.QtGui.QStyleHints.startDragTimeChanged(startDragTime)
Parameters

startDragTime – int

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

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

PySide2.QtGui.QStyleHints.tabFocusBehaviorChanged(tabFocusBehavior)
Parameters

tabFocusBehaviorTabFocusBehavior

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

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

PySide2.QtGui.QStyleHints.useHoverEffectsChanged(useHoverEffects)
Parameters

useHoverEffects – bool

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

PySide2.QtGui.QStyleHints.wheelScrollLines()
Return type

int

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

PySide2.QtGui.QStyleHints.wheelScrollLinesChanged(scrollLines)
Parameters

scrollLines – int