继承者: QSlider , QDial , QScrollBar
PySide.QtGui.QAbstractSlider class provides an integer value within a range.
此类被设计作为 Widget 的通用超类像 PySide.QtGui.QScrollBar , PySide.QtGui.QSlider and PySide.QtGui.QDial .
这里是类的主要特性:
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:
| 信号 | 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.
| 参数: | parent – PySide.QtGui.QWidget |
|---|
构造抽象滑块。
parent 自变量被发送给 PySide.QtGui.QWidget 构造函数。
PySide.QtGui.QAbstractSlider.minimum() 默认为 0, PySide.QtGui.QAbstractSlider.maximum() 到 99,采用 PySide.QtGui.QAbstractSlider.singleStep() 1 尺寸和 PySide.QtGui.QAbstractSlider.pageStep() 10 尺寸,及初始 PySide.QtGui.QAbstractSlider.value() of 0.
| 常量 | 描述 |
|---|---|
| QAbstractSlider.SliderNoAction | |
| QAbstractSlider.SliderSingleStepAdd | |
| QAbstractSlider.SliderSingleStepSub | |
| QAbstractSlider.SliderPageStepAdd | |
| QAbstractSlider.SliderPageStepSub | |
| QAbstractSlider.SliderToMinimum | |
| QAbstractSlider.SliderToMaximum | |
| QAbstractSlider.SliderMove |
| 常量 | 描述 |
|---|---|
| QAbstractSlider.SliderRangeChange | |
| QAbstractSlider.SliderOrientationChange | |
| QAbstractSlider.SliderStepsChange | |
| QAbstractSlider.SliderValueChange |
| 参数: | action – PySide.QtCore.int |
|---|
| 返回类型: | PySide.QtCore.bool |
|---|
This property holds whether slider tracking is enabled.
若跟踪被启用 (默认),滑块发射 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.
另请参阅
sliderDown()
| 返回类型: | 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.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.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.QtCore.int |
|---|
This property holds the slider's maximum value.
当设置此特性时, 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.QtCore.int |
|---|
This property holds the sliders's minimum value.
当设置此特性时, 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.QtCore.Qt.Orientation |
|---|
This property holds the orientation of the slider.
取向必须是 Qt.Vertical (默认) 或 Qt.Horizontal .
| 返回类型: | PySide.QtCore.int |
|---|
This property holds the page step..
抽象滑块提供 2 自然步幅的较大者,通常相当于用户按下 PageUp 或 PageDown。
| 参数: |
|
|---|
| 返回类型: | PySide.QtGui.QAbstractSlider.SliderAction |
|---|
返回当前的重复动作。
| 参数: | 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.
| 参数: | 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.
| 参数: | arg__1 – PySide.QtCore.int |
|---|
This property holds the slider's maximum value.
当设置此特性时, 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.
| 参数: | arg__1 – PySide.QtCore.int |
|---|
This property holds the sliders's minimum value.
当设置此特性时, 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.
| 参数: | arg__1 – PySide.QtCore.Qt.Orientation |
|---|
This property holds the orientation of the slider.
取向必须是 Qt.Vertical (默认) 或 Qt.Horizontal .
| 参数: | arg__1 – PySide.QtCore.int |
|---|
This property holds the page step..
抽象滑块提供 2 自然步幅的较大者,通常相当于用户按下 PageUp 或 PageDown。
| 参数: |
|
|---|
Sets the slider's minimum to min and its maximum to max .
若 max 小于 min , min 变为唯一合法值。
| 参数: |
|
|---|
设置动作 action to be triggered repetitively in intervals of repeatTime , after an initial delay of thresholdTime .
| 参数: | arg__1 – PySide.QtCore.int |
|---|
This property holds the single step..
抽象滑块提供 2 自然步幅的较小者,通常相当于用户按下箭头键。
若在自动重复键事件期间修改特性,行为不确定。
| 参数: | 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.
| 参数: | arg__1 – PySide.QtCore.int |
|---|
This property holds the current slider position.
若 tracking() is enabled (the default), this is identical to PySide.QtGui.QAbstractSlider.value() .
| 参数: | enable – PySide.QtCore.bool |
|---|
This property holds whether slider tracking is enabled.
若跟踪被启用 (默认),滑块发射 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.
另请参阅
sliderDown()
| 参数: | arg__1 – PySide.QtCore.int |
|---|
This property holds the slider's current value.
滑块将值强制在合法范围内: PySide.QtGui.QAbstractSlider.minimum() <= value <= PySide.QtGui.QAbstractSlider.maximum() .
| 返回类型: | PySide.QtCore.int |
|---|
This property holds the single step..
抽象滑块提供 2 自然步幅的较小者,通常相当于用户按下箭头键。
若在自动重复键事件期间修改特性,行为不确定。
| 参数: | change – PySide.QtGui.QAbstractSlider.SliderChange |
|---|
Reimplement this virtual function to track slider changes such as SliderRangeChange , SliderOrientationChange , SliderStepsChange ,或 SliderValueChange . The default implementation only updates the display and ignores the change 参数。
| 参数: | position – PySide.QtCore.int |
|---|
| 返回类型: | PySide.QtCore.int |
|---|
This property holds the current slider position.
若 tracking() is enabled (the default), this is identical to PySide.QtGui.QAbstractSlider.value() .
| 参数: | action – PySide.QtGui.QAbstractSlider.SliderAction |
|---|
触发滑块 action 。可能的动作是 SliderSingleStepAdd , SliderSingleStepSub , SliderPageStepAdd , SliderPageStepSub , SliderToMinimum , SliderToMaximum ,和 SliderMove .
| 返回类型: | PySide.QtCore.int |
|---|
This property holds the slider's current value.
滑块将值强制在合法范围内: PySide.QtGui.QAbstractSlider.minimum() <= value <= PySide.QtGui.QAbstractSlider.maximum() .
| 参数: | value – PySide.QtCore.int |
|---|