QStyleHints#
The QStyleHints
class contains platform specific hints and settings. More…
Synopsis#
Properties#
colorScheme
- The color scheme of the platform themecursorFlashTime
- The text cursor’s flash (blink) time in millisecondsfontSmoothingGamma
- The gamma value used in font smoothingkeyboardAutoRepeatRate
- 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() insteadkeyboardAutoRepeatRateF
- The rate, in events per second, in which additional repeated key presses will automatically be generated if a key is being held downkeyboardInputInterval
- The time limit, in milliseconds, that distinguishes a key press from two consecutive key pressesmouseDoubleClickDistance
- The maximum distance, in pixels, that the mouse can be moved between two consecutive mouse clicks and still have it detected as a double-clickmouseDoubleClickInterval
- The time limit in milliseconds that distinguishes a double click from two consecutive mouse clicksmousePressAndHoldInterval
- The time limit in milliseconds that activates a press and holdmouseQuickSelectionThreshold
- Quick selection mouse threshold in QLineEditpasswordMaskCharacter
- The character used to mask the characters typed into text input fields in password modepasswordMaskDelay
- The time, in milliseconds, a typed letter is displayed unshrouded in a text input field in password modesetFocusOnTouchRelease
- The event that should set input focus on focus objectsshowIsFullScreen
- Whether the platform defaults to fullscreen windowsshowIsMaximized
- Whether the platform defaults to maximized windowsshowShortcutsInContextMenus
- True if the platform normally shows shortcut key sequences in context menus, otherwise falsesingleClickActivation
- Whether items are activated by single or double clickstartDragDistance
- The distance, in pixels, that the mouse must be moved with a button held down before a drag and drop operation will beginstartDragTime
- The time, in milliseconds, that a mouse button must be held down before a drag and drop operation will beginstartDragVelocity
- 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 limittabFocusBehavior
- Focus behavior on press of the tab keytouchDoubleTapDistance
- The maximum distance, in pixels, that a finger can be moved between two consecutive taps and still have it detected as a double-tapuseHoverEffects
- Whether UI elements use hover effectsuseRtlExtensions
- The writing directionwheelScrollLines
- Number of lines to scroll by default for each wheel click
Functions#
def
colorScheme
()def
cursorFlashTime
()def
fontSmoothingGamma
()def
keyboardAutoRepeatRate
()def
keyboardAutoRepeatRateF
()def
keyboardInputInterval
()def
mouseDoubleClickDistance
()def
mouseDoubleClickInterval
()def
mousePressAndHoldInterval
()def
mouseQuickSelectionThreshold
()def
passwordMaskCharacter
()def
passwordMaskDelay
()def
setCursorFlashTime
(cursorFlashTime)def
setFocusOnTouchRelease
()def
setKeyboardInputInterval
(keyboardInputInterval)def
setMouseDoubleClickInterval
(mouseDoubleClickInterval)def
setMousePressAndHoldInterval
(mousePressAndHoldInterval)def
setMouseQuickSelectionThreshold
(threshold)def
setShowShortcutsInContextMenus
(showShortcutsInContextMenus)def
setStartDragDistance
(startDragDistance)def
setStartDragTime
(startDragTime)def
setTabFocusBehavior
(tabFocusBehavior)def
setUseHoverEffects
(useHoverEffects)def
setWheelScrollLines
(scrollLines)def
showIsFullScreen
()def
showIsMaximized
()def
showShortcutsInContextMenus
()def
singleClickActivation
()def
startDragDistance
()def
startDragTime
()def
startDragVelocity
()def
tabFocusBehavior
()def
touchDoubleTapDistance
()def
useHoverEffects
()def
useRtlExtensions
()def
wheelScrollLines
()
Signals#
def
colorSchemeChanged
(colorScheme)def
cursorFlashTimeChanged
(cursorFlashTime)def
keyboardInputIntervalChanged
(keyboardInputInterval)def
mouseDoubleClickIntervalChanged
(mouseDoubleClickInterval)def
mousePressAndHoldIntervalChanged
(mousePressAndHoldInterval)def
mouseQuickSelectionThresholdChanged
(threshold)def
showShortcutsInContextMenusChanged
(arg__1)def
startDragDistanceChanged
(startDragDistance)def
startDragTimeChanged
(startDragTime)def
tabFocusBehaviorChanged
(tabFocusBehavior)def
useHoverEffectsChanged
(useHoverEffects)def
wheelScrollLinesChanged
(scrollLines)
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
- 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:
colorScheme
()Signal
colorSchemeChanged
(colorScheme)
- 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:
Signal
cursorFlashTimeChanged
(cursorFlashTime)
- 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:
Signal
keyboardInputIntervalChanged
(keyboardInputInterval)
- 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:
Signal
mouseDoubleClickIntervalChanged
(mouseDoubleClickInterval)
- property PᅟySide6.QtGui.QStyleHints.mousePressAndHoldInterval: int#
This property holds the time limit in milliseconds that activates a press and hold..
- Access functions:
Signal
mousePressAndHoldIntervalChanged
(mousePressAndHoldInterval)
- 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:
setMouseQuickSelectionThreshold
(threshold)Signal
mouseQuickSelectionThresholdChanged
(threshold)
- 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.
See also
- 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.
See also
- 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:
setShowShortcutsInContextMenus
(showShortcutsInContextMenus)Signal
showShortcutsInContextMenusChanged
(arg__1)
- 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()See also
- Access functions:
Signal
startDragDistanceChanged
(startDragDistance)
- 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.
See also
- Access functions:
Signal
startDragTimeChanged
(startDragTime)
- 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..
See also
- 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:
Signal
tabFocusBehaviorChanged
(tabFocusBehavior)
- 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:
setUseHoverEffects
(useHoverEffects)Signal
useHoverEffectsChanged
(useHoverEffects)
- 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:
Signal
wheelScrollLinesChanged
(scrollLines)
- PySide6.QtGui.QStyleHints.colorScheme()#
- Return type:
Getter of property colorScheme
.
- PySide6.QtGui.QStyleHints.colorSchemeChanged(colorScheme)#
- Parameters:
colorScheme –
ColorScheme
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
See also
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:
tabFocusBehavior –
TabFocusBehavior
- PySide6.QtGui.QStyleHints.setUseHoverEffects(useHoverEffects)#
- Parameters:
useHoverEffects – bool
See also
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
See also
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:
Getter of property tabFocusBehavior
.
- PySide6.QtGui.QStyleHints.tabFocusBehaviorChanged(tabFocusBehavior)#
- Parameters:
tabFocusBehavior –
TabFocusBehavior
Notification signal of property tabFocusBehavior
.
- PySide6.QtGui.QStyleHints.touchDoubleTapDistance()#
- Return type:
int
Getter of property touchDoubleTapDistance
.
- PySide6.QtGui.QStyleHints.useHoverEffects()#
- Return type:
bool
See also
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
.