PySide6.QtWidgets.QAbstractSlider¶
- class QAbstractSlider¶
- The - QAbstractSliderclass provides an integer value within a range. More…- Inherited by: - QSlider,- QScrollBar,- QDial- Synopsis¶- Properties¶- invertedAppearanceᅟ- Whether or not a slider shows its values inverted
- invertedControlsᅟ- Whether or not the slider inverts its wheel and key events
- maximumᅟ- The slider’s maximum value
- minimumᅟ- The sliders’s minimum value
- orientationᅟ- The orientation of the slider
- pageStepᅟ- The page step
- singleStepᅟ- The single step
- sliderDownᅟ- Whether the slider is pressed down
- sliderPositionᅟ- The current slider position
- trackingᅟ- Whether slider tracking is enabled
- valueᅟ- The slider’s current value
 - Methods¶- def - __init__()
- def - hasTracking()
- def - isSliderDown()
- def - maximum()
- def - minimum()
- def - orientation()
- def - pageStep()
- def - repeatAction()
- def - setMaximum()
- def - setMinimum()
- def - setPageStep()
- def - setSingleStep()
- def - setSliderDown()
- def - setTracking()
- def - singleStep()
- def - sliderPosition()
- def - triggerAction()
- def - value()
 - Virtual methods¶- def - sliderChange()
 - Slots¶- def - setOrientation()
- def - setRange()
- def - setValue()
 - Signals¶
- def - rangeChanged()
- def - sliderMoved()
- def - sliderPressed()
- def - sliderReleased()
- def - valueChanged()
 - 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¶- The class is designed as a common super class for widgets like - QScrollBar,- QSliderand- QDial.- Here are the main properties of the class: - value: The bounded integer that- QAbstractSlidermaintains.
- minimum: The lowest possible value.
- maximum: The highest possible value.
- singleStep: The smaller of two natural steps that an abstract sliders provides and typically corresponds to the user pressing an arrow key.
- pageStep: The larger of two natural steps that an abstract slider provides and typically corresponds to the user pressing PageUp or PageDown.
- tracking: Whether slider tracking is enabled.
- sliderPosition: The current position of the slider. If- trackingis enabled (the default), this is identical to- value.
 - Unity (1) may be viewed as a third step size. - setValue()lets you set the current value to any integer in the allowed range, not just- minimum()+ n *- singleStep()for integer values of n. Some widgets may allow the user to set any value at all; others may just provide multiples of- singleStep()or- pageStep().- QAbstractSlideremits a comprehensive set of signals:- Signal - Emitted when - the value has changed. The - trackingdetermines whether this signal is emitted during user interaction.- the user starts to drag the slider. - the user drags the slider. - the user releases the slider. - a slider action was triggered. - a the range has changed. - QAbstractSliderprovides a virtual- sliderChange()function that is well suited for updating the on-screen representation of sliders. By calling- triggerAction(), subclasses trigger slider actions. Two helper functions- sliderPositionFromValue()and- sliderValueFromPosition()help subclasses and styles to map screen coordinates to logical range values.- See also - QAbstractSpinBox- QSlider- QDial- QScrollBarSliders Example- class SliderAction¶
- Constant - Description - QAbstractSlider.SliderNoAction - QAbstractSlider.SliderSingleStepAdd - QAbstractSlider.SliderSingleStepSub - QAbstractSlider.SliderPageStepAdd - QAbstractSlider.SliderPageStepSub - QAbstractSlider.SliderToMinimum - QAbstractSlider.SliderToMaximum - QAbstractSlider.SliderMove 
 - class SliderChange¶
- Constant - Description - QAbstractSlider.SliderRangeChange - QAbstractSlider.SliderOrientationChange - QAbstractSlider.SliderStepsChange - QAbstractSlider.SliderValueChange 
 - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property invertedAppearanceᅟ: bool¶
 - This property holds whether or not a slider shows its values inverted.. - If this property is - false(the default), the minimum and maximum will be shown in its classic position for the inherited widget. If the value is true, the minimum and maximum appear at their opposite location.- Note: This property makes most sense for sliders and dials. For scroll bars, the visual effect of the scroll bar subcontrols depends on whether or not the styles understand inverted appearance; most styles ignore this property for scroll bars. - Access functions:
 - property invertedControlsᅟ: bool¶
 - This property holds whether or not the slider inverts its wheel and key events.. - If this property is - false, scrolling the mouse wheel “up” and using keys like page up will increase the slider’s value towards its maximum. Otherwise pressing page up will move value towards the slider’s minimum.- Access functions:
 - property maximumᅟ: int¶
 - This property holds the slider’s maximum value. - When setting this property, the - minimumis adjusted if necessary to ensure that the range remains valid. Also the slider’s current value is adjusted to be within the new range.- Access functions:
 - property minimumᅟ: int¶
 - This property holds the sliders’s minimum value. - When setting this property, the - maximumis adjusted if necessary to ensure that the range remains valid. Also the slider’s current value is adjusted to be within the new range.- Access functions:
 - property orientationᅟ: Qt.Orientation¶
 - This property holds the orientation of the slider. - The orientation must be Qt::Vertical (the default) or Qt::Horizontal. - Access functions:
 - property pageStepᅟ: int¶
 - This property holds the page step.. - The larger of two natural steps that an abstract slider provides and typically corresponds to the user pressing PageUp or PageDown. - See also - Access functions:
 - property singleStepᅟ: int¶
 - This property holds the single step.. - The smaller of two natural steps that an abstract sliders provides and typically corresponds to the user pressing an arrow key. - If the property is modified during an auto repeating key event, behavior is undefined. - See also - Access functions:
 - property sliderDownᅟ: bool¶
 - This property holds whether the slider is pressed down.. - The property is set by subclasses in order to let the abstract slider know whether or not - trackinghas any effect.- Changing the slider down property emits the - sliderPressed()and- sliderReleased()signals.- Access functions:
 - property sliderPositionᅟ: int¶
 - This property holds the current slider position. - If - trackingis enabled (the default), this is identical to- value.- Access functions:
 - property trackingᅟ: bool¶
 - This property holds whether slider tracking is enabled. - If tracking is enabled (the default), the slider emits the - valueChanged()signal while the slider is being dragged. If tracking is disabled, the slider emits the- valueChanged()signal only when the user releases the slider.- See also - sliderDown- Access functions:
 - property valueᅟ: int¶
 - This property holds the slider’s current value. - The slider forces the value to be within the legal range: - minimum<=- value<=- maximum.- Changing the value also changes the - sliderPosition.- Access functions:
- Signal - valueChanged()
 
 - Constructs an abstract slider. - The - parentargument is sent to the- QWidgetconstructor.- The - minimumdefaults to 0, the- maximumto 99, with a- singleStepsize of 1 and a- pageStepsize of 10, and an initial- valueof 0.- actionTriggered(action)¶
- Parameters:
- action – int 
 
 - This signal is emitted when the slider action - actionis triggered. Actions are- SliderSingleStepAdd,- SliderSingleStepSub,- SliderPageStepAdd,- SliderPageStepSub,- SliderToMinimum,- SliderToMaximum, and- SliderMove.- When the signal is emitted, the - sliderPositionhas been adjusted according to the action, but the- valuehas not yet been propagated (meaning the- valueChanged()signal was not yet emitted), and the visual display has not been updated. In slots connected to this signal you can thus safely adjust any action by calling- setSliderPosition()yourself, based on both the action and the slider’s value.- See also - hasTracking()¶
- Return type:
- bool 
 
 - Getter of property - trackingᅟ.- invertedAppearance()¶
- Return type:
- bool 
 - See also 
 - Getter of property - invertedAppearanceᅟ.- invertedControls()¶
- Return type:
- bool 
 - See also 
 - Getter of property - invertedControlsᅟ.- isSliderDown()¶
- Return type:
- bool 
 
 - Getter of property - sliderDownᅟ.- maximum()¶
- Return type:
- int 
 - See also 
 - Getter of property - maximumᅟ.- minimum()¶
- Return type:
- int 
 - See also 
 - Getter of property - minimumᅟ.- orientation()¶
- Return type:
 - See also 
 - Getter of property - orientationᅟ.- pageStep()¶
- Return type:
- int 
 - See also 
 - Getter of property - pageStepᅟ.- rangeChanged(min, max)¶
- Parameters:
- min – int 
- max – int 
 
 
 - This signal is emitted when the slider range has changed, with - minbeing the new minimum, and- maxbeing the new maximum.- repeatAction()¶
- Return type:
 
 - Returns the current repeat action. - See also - setInvertedAppearance(arg__1)¶
- Parameters:
- arg__1 – bool 
 - See also 
 - Setter of property - invertedAppearanceᅟ.- setInvertedControls(arg__1)¶
- Parameters:
- arg__1 – bool 
 - See also 
 - Setter of property - invertedControlsᅟ.- Setter of property - maximumᅟ.- Setter of property - minimumᅟ.- setOrientation(arg__1)¶
- Parameters:
- arg__1 – - Orientation
 - See also 
 - Setter of property - orientationᅟ.- setPageStep(arg__1)¶
- Parameters:
- arg__1 – int 
 - See also 
 - Setter of property - pageStepᅟ.- setRange(min, max)¶
- Parameters:
- min – int 
- max – int 
 
 
 - Sets the slider’s minimum to - minand its maximum to- max.- If - maxis smaller than- min,- minbecomes the only legal value.- setRepeatAction(action[, thresholdTime=500[, repeatTime=50]])¶
- Parameters:
- action – - SliderAction
- thresholdTime – int 
- repeatTime – int 
 
 
 - Sets action - actionto be triggered repetitively in intervals of- repeatTime, after an initial delay of- thresholdTime.- See also - setSingleStep(arg__1)¶
- Parameters:
- arg__1 – int 
 - See also 
 - Setter of property - singleStepᅟ.- setSliderDown(arg__1)¶
- Parameters:
- arg__1 – bool 
 - See also 
 - Setter of property - sliderDownᅟ.- setSliderPosition(arg__1)¶
- Parameters:
- arg__1 – int 
 - See also 
 - Setter of property - sliderPositionᅟ.- setTracking(enable)¶
- Parameters:
- enable – bool 
 - See also 
 - Setter of property - trackingᅟ.- Setter of property - valueᅟ.- singleStep()¶
- Return type:
- int 
 - See also 
 - Getter of property - singleStepᅟ.- sliderChange(change)¶
- Parameters:
- change – - SliderChange
 
 - Reimplement this virtual function to track slider changes such as - SliderRangeChange,- SliderOrientationChange,- SliderStepsChange, or- SliderValueChange. The default implementation only updates the display and ignores the- changeparameter.- sliderMoved(position)¶
- Parameters:
- position – int 
 
 - This signal is emitted when - sliderDownis true and the slider moves. This usually happens when the user is dragging the slider. The- valueis the new slider position.- This signal is emitted even when tracking is turned off. - Notification signal of property - sliderPositionᅟ.- sliderPosition()¶
- Return type:
- int 
 - See also 
 - Getter of property - sliderPositionᅟ.- sliderPressed()¶
 - This signal is emitted when the user presses the slider with the mouse, or programmatically when - setSliderDown(true) is called.- See also - sliderReleased()¶
 - This signal is emitted when the user releases the slider with the mouse, or programmatically when - setSliderDown(false) is called.- See also - sliderPressed()- sliderMoved()- sliderDown- triggerAction(action)¶
- Parameters:
- action – - SliderAction
 
 - Triggers a slider - action. Possible actions are- SliderSingleStepAdd,- SliderSingleStepSub,- SliderPageStepAdd,- SliderPageStepSub,- SliderToMinimum,- SliderToMaximum, and- SliderMove.- See also - value()¶
- Return type:
- int 
 - See also 
 - Getter of property - valueᅟ.- valueChanged(value)¶
- Parameters:
- value – int 
 
 - This signal is emitted when the slider value has changed, with the new slider - valueas argument.- Notification signal of property - valueᅟ.