Inherited by: QSlider, QDial, QScrollBar
The PySide.QtGui.QAbstractSlider class provides an integer value within a range.
The class is designed as a common super class for widgets like PySide.QtGui.QScrollBar , PySide.QtGui.QSlider and PySide.QtGui.QDial .
Here are the main properties of the class:
Unity (1) may be viewed as a third step size. PySide.QtGui.QAbstractSlider.setValue() lets you set the current value to any integer in the allowed range, not just PySide.QtGui.QAbstractSlider.minimum() + n * PySide.QtGui.QAbstractSlider.singleStep() for integer values of n . Some widgets may allow the user to set any value at all; others may just provide multiples of PySide.QtGui.QAbstractSlider.singleStep() or PySide.QtGui.QAbstractSlider.pageStep() .
PySide.QtGui.QAbstractSlider emits a comprehensive set of signals:
Signal Emitted when PySide.QtGui.QAbstractSlider.valueChanged() the value has changed. The tracking() determines whether this signal is emitted during user interaction. PySide.QtGui.QAbstractSlider.sliderPressed() the user starts to drag the slider. PySide.QtGui.QAbstractSlider.sliderMoved() the user drags the slider. PySide.QtGui.QAbstractSlider.sliderReleased() the user releases the slider. PySide.QtGui.QAbstractSlider.actionTriggered() a slider action was triggerd. PySide.QtGui.QAbstractSlider.rangeChanged() a the range has changed. PySide.QtGui.QAbstractSlider provides a virtual PySide.QtGui.QAbstractSlider.sliderChange() function that is well suited for updating the on-screen representation of sliders. By calling PySide.QtGui.QAbstractSlider.triggerAction() , subclasses trigger slider actions. Two helper functions QStyle.sliderPositionFromValue() and QStyle.sliderValueFromPosition() help subclasses and styles to map screen coordinates to logical range values.
See also
PySide.QtGui.QAbstractSpinBox PySide.QtGui.QSlider PySide.QtGui.QDial PySide.QtGui.QScrollBar Sliders Example
Parameters: | parent – PySide.QtGui.QWidget |
---|
Constructs an abstract slider.
The parent argument is sent to the PySide.QtGui.QWidget constructor.
The PySide.QtGui.QAbstractSlider.minimum() defaults to 0, the PySide.QtGui.QAbstractSlider.maximum() to 99, with a PySide.QtGui.QAbstractSlider.singleStep() size of 1 and a PySide.QtGui.QAbstractSlider.pageStep() size of 10, and an initial PySide.QtGui.QAbstractSlider.value() of 0.
Constant | Description |
---|---|
QAbstractSlider.SliderNoAction | |
QAbstractSlider.SliderSingleStepAdd | |
QAbstractSlider.SliderSingleStepSub | |
QAbstractSlider.SliderPageStepAdd | |
QAbstractSlider.SliderPageStepSub | |
QAbstractSlider.SliderToMinimum | |
QAbstractSlider.SliderToMaximum | |
QAbstractSlider.SliderMove |
Constant | Description |
---|---|
QAbstractSlider.SliderRangeChange | |
QAbstractSlider.SliderOrientationChange | |
QAbstractSlider.SliderStepsChange | |
QAbstractSlider.SliderValueChange |
Parameters: | action – PySide.QtCore.int |
---|
Return type: | PySide.QtCore.bool |
---|
This property holds whether slider tracking is enabled.
If tracking is enabled (the default), the slider emits the PySide.QtGui.QAbstractSlider.valueChanged() signal while the slider is being dragged. If tracking is disabled, the slider emits the PySide.QtGui.QAbstractSlider.valueChanged() signal only when the user releases the slider.
See also
sliderDown()
Return type: | PySide.QtCore.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.
Return type: | PySide.QtCore.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.
Return type: | PySide.QtCore.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 tracking() has any effect.
Changing the slider down property emits the PySide.QtGui.QAbstractSlider.sliderPressed() and PySide.QtGui.QAbstractSlider.sliderReleased() signals.
Return type: | PySide.QtCore.int |
---|
This property holds the slider’s maximum value.
When setting this property, the PySide.QtGui.QAbstractSlider.minimum() is adjusted if necessary to ensure that the range remains valid. Also the slider’s current value is adjusted to be within the new range.
Return type: | PySide.QtCore.int |
---|
This property holds the sliders’s minimum value.
When setting this property, the PySide.QtGui.QAbstractSlider.maximum() is adjusted if necessary to ensure that the range remains valid. Also the slider’s current value is adjusted to be within the new range.
Return type: | PySide.QtCore.Qt.Orientation |
---|
This property holds the orientation of the slider.
The orientation must be Qt.Vertical (the default) or Qt.Horizontal .
Return type: | PySide.QtCore.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.
Parameters: |
|
---|
Return type: | PySide.QtGui.QAbstractSlider.SliderAction |
---|
Returns the current repeat action.
Parameters: | arg__1 – PySide.QtCore.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.
Parameters: | arg__1 – PySide.QtCore.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.
Parameters: | arg__1 – PySide.QtCore.int |
---|
This property holds the slider’s maximum value.
When setting this property, the PySide.QtGui.QAbstractSlider.minimum() is adjusted if necessary to ensure that the range remains valid. Also the slider’s current value is adjusted to be within the new range.
Parameters: | arg__1 – PySide.QtCore.int |
---|
This property holds the sliders’s minimum value.
When setting this property, the PySide.QtGui.QAbstractSlider.maximum() is adjusted if necessary to ensure that the range remains valid. Also the slider’s current value is adjusted to be within the new range.
Parameters: | arg__1 – PySide.QtCore.Qt.Orientation |
---|
This property holds the orientation of the slider.
The orientation must be Qt.Vertical (the default) or Qt.Horizontal .
Parameters: | arg__1 – PySide.QtCore.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.
Parameters: |
|
---|
Sets the slider’s minimum to min and its maximum to max .
If max is smaller than min , min becomes the only legal value.
Parameters: |
|
---|
Sets action action to be triggered repetitively in intervals of repeatTime , after an initial delay of thresholdTime .
Parameters: | arg__1 – PySide.QtCore.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.
Parameters: | arg__1 – PySide.QtCore.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 tracking() has any effect.
Changing the slider down property emits the PySide.QtGui.QAbstractSlider.sliderPressed() and PySide.QtGui.QAbstractSlider.sliderReleased() signals.
Parameters: | arg__1 – PySide.QtCore.int |
---|
This property holds the current slider position.
If tracking() is enabled (the default), this is identical to PySide.QtGui.QAbstractSlider.value() .
Parameters: | enable – PySide.QtCore.bool |
---|
This property holds whether slider tracking is enabled.
If tracking is enabled (the default), the slider emits the PySide.QtGui.QAbstractSlider.valueChanged() signal while the slider is being dragged. If tracking is disabled, the slider emits the PySide.QtGui.QAbstractSlider.valueChanged() signal only when the user releases the slider.
See also
sliderDown()
Parameters: | arg__1 – PySide.QtCore.int |
---|
This property holds the slider’s current value.
The slider forces the value to be within the legal range: PySide.QtGui.QAbstractSlider.minimum() <= value <= PySide.QtGui.QAbstractSlider.maximum() .
Changing the value also changes the PySide.QtGui.QAbstractSlider.sliderPosition() .
Return type: | PySide.QtCore.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.
Parameters: | change – PySide.QtGui.QAbstractSlider.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 change parameter.
Parameters: | position – PySide.QtCore.int |
---|
Return type: | PySide.QtCore.int |
---|
This property holds the current slider position.
If tracking() is enabled (the default), this is identical to PySide.QtGui.QAbstractSlider.value() .
Parameters: | action – PySide.QtGui.QAbstractSlider.SliderAction |
---|
Triggers a slider action . Possible actions are SliderSingleStepAdd , SliderSingleStepSub , SliderPageStepAdd , SliderPageStepSub , SliderToMinimum , SliderToMaximum , and SliderMove .
Return type: | PySide.QtCore.int |
---|
This property holds the slider’s current value.
The slider forces the value to be within the legal range: PySide.QtGui.QAbstractSlider.minimum() <= value <= PySide.QtGui.QAbstractSlider.maximum() .
Changing the value also changes the PySide.QtGui.QAbstractSlider.sliderPosition() .
Parameters: | value – PySide.QtCore.int |
---|