QStyleHints¶
The
QStyleHints
class contains platform specific hints and settings. More…
Synopsis¶
Functions¶
def
cursorFlashTime
()def
fontSmoothingGamma
()def
keyboardAutoRepeatRate
()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
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)
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
- 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
.See also
- 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
.See also
- PySide2.QtGui.QStyleHints.setMouseDoubleClickInterval(mouseDoubleClickInterval)¶
- Parameters:
mouseDoubleClickInterval – int
Sets the
mouseDoubleClickInterval
.See also
- PySide2.QtGui.QStyleHints.setMousePressAndHoldInterval(mousePressAndHoldInterval)¶
- Parameters:
mousePressAndHoldInterval – int
Sets the
mousePressAndHoldInterval
.See also
- 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, otherwisefalse
..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
.See also
- PySide2.QtGui.QStyleHints.setStartDragTime(startDragTime)¶
- Parameters:
startDragTime – int
Sets the
startDragDragTime
.See also
- PySide2.QtGui.QStyleHints.setTabFocusBehavior(tabFocusBehavior)¶
- Parameters:
tabFocusBehavior –
TabFocusBehavior
Sets the
tabFocusBehavior
.See also
- 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
.See also
- 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, otherwisefalse
.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
- 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, otherwisefalse
.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
- PySide2.QtGui.QStyleHints.showShortcutsInContextMenus()¶
- Return type:
bool
This property holds
true
if the platform normally shows shortcut key sequences in context menus, otherwisefalse
..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) iscurrentPos
, 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.
See also
- 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..
See also
- PySide2.QtGui.QStyleHints.tabFocusBehavior()¶
- Return type:
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:
tabFocusBehavior –
TabFocusBehavior
- 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, otherwisefalse
.
- 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
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.