QAbstractSlider

Inherited by: QSlider, QDial, QScrollBar

Synopsis

Functions

Virtual functions

Slots

Signals

Detailed Description

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.

class PySide.QtGui.QAbstractSlider([parent=None])
Parameters:parentPySide.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.

PySide.QtGui.QAbstractSlider.SliderAction
Constant Description
QAbstractSlider.SliderNoAction  
QAbstractSlider.SliderSingleStepAdd  
QAbstractSlider.SliderSingleStepSub  
QAbstractSlider.SliderPageStepAdd  
QAbstractSlider.SliderPageStepSub  
QAbstractSlider.SliderToMinimum  
QAbstractSlider.SliderToMaximum  
QAbstractSlider.SliderMove  
PySide.QtGui.QAbstractSlider.SliderChange
Constant Description
QAbstractSlider.SliderRangeChange  
QAbstractSlider.SliderOrientationChange  
QAbstractSlider.SliderStepsChange  
QAbstractSlider.SliderValueChange  
PySide.QtGui.QAbstractSlider.actionTriggered(action)
Parameters:actionPySide.QtCore.int
PySide.QtGui.QAbstractSlider.hasTracking()
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()

PySide.QtGui.QAbstractSlider.invertedAppearance()
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.

PySide.QtGui.QAbstractSlider.invertedControls()
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.

PySide.QtGui.QAbstractSlider.isSliderDown()
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.

PySide.QtGui.QAbstractSlider.maximum()
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.

PySide.QtGui.QAbstractSlider.minimum()
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.

PySide.QtGui.QAbstractSlider.orientation()
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 .

PySide.QtGui.QAbstractSlider.pageStep()
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.

PySide.QtGui.QAbstractSlider.rangeChanged(min, max)
Parameters:
  • minPySide.QtCore.int
  • maxPySide.QtCore.int
PySide.QtGui.QAbstractSlider.repeatAction()
Return type:PySide.QtGui.QAbstractSlider.SliderAction

Returns the current repeat action.

PySide.QtGui.QAbstractSlider.setInvertedAppearance(arg__1)
Parameters:arg__1PySide.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.

PySide.QtGui.QAbstractSlider.setInvertedControls(arg__1)
Parameters:arg__1PySide.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.

PySide.QtGui.QAbstractSlider.setMaximum(arg__1)
Parameters:arg__1PySide.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.

PySide.QtGui.QAbstractSlider.setMinimum(arg__1)
Parameters:arg__1PySide.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.

PySide.QtGui.QAbstractSlider.setOrientation(arg__1)
Parameters:arg__1PySide.QtCore.Qt.Orientation

This property holds the orientation of the slider.

The orientation must be Qt.Vertical (the default) or Qt.Horizontal .

PySide.QtGui.QAbstractSlider.setPageStep(arg__1)
Parameters:arg__1PySide.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.

PySide.QtGui.QAbstractSlider.setRange(min, max)
Parameters:
  • minPySide.QtCore.int
  • maxPySide.QtCore.int

Sets the slider’s minimum to min and its maximum to max .

If max is smaller than min , min becomes the only legal value.

PySide.QtGui.QAbstractSlider.setRepeatAction(action[, thresholdTime=500[, repeatTime=50]])
Parameters:

Sets action action to be triggered repetitively in intervals of repeatTime , after an initial delay of thresholdTime .

PySide.QtGui.QAbstractSlider.setSingleStep(arg__1)
Parameters:arg__1PySide.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.

PySide.QtGui.QAbstractSlider.setSliderDown(arg__1)
Parameters:arg__1PySide.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.

PySide.QtGui.QAbstractSlider.setSliderPosition(arg__1)
Parameters:arg__1PySide.QtCore.int

This property holds the current slider position.

If tracking() is enabled (the default), this is identical to PySide.QtGui.QAbstractSlider.value() .

PySide.QtGui.QAbstractSlider.setTracking(enable)
Parameters:enablePySide.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()

PySide.QtGui.QAbstractSlider.setValue(arg__1)
Parameters:arg__1PySide.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() .

PySide.QtGui.QAbstractSlider.singleStep()
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.

PySide.QtGui.QAbstractSlider.sliderChange(change)
Parameters:changePySide.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.

PySide.QtGui.QAbstractSlider.sliderMoved(position)
Parameters:positionPySide.QtCore.int
PySide.QtGui.QAbstractSlider.sliderPosition()
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() .

PySide.QtGui.QAbstractSlider.sliderPressed()
PySide.QtGui.QAbstractSlider.sliderReleased()
PySide.QtGui.QAbstractSlider.triggerAction(action)
Parameters:actionPySide.QtGui.QAbstractSlider.SliderAction

Triggers a slider action . Possible actions are SliderSingleStepAdd , SliderSingleStepSub , SliderPageStepAdd , SliderPageStepSub , SliderToMinimum , SliderToMaximum , and SliderMove .

PySide.QtGui.QAbstractSlider.value()
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() .

PySide.QtGui.QAbstractSlider.valueChanged(value)
Parameters:valuePySide.QtCore.int