• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QSplitterHandle

    下一话题

    QSlider

    QAbstractSlider

    继承者: 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.

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

    PySide.QtGui.QAbstractSlider. SliderAction
    常量 描述
    QAbstractSlider.SliderNoAction  
    QAbstractSlider.SliderSingleStepAdd  
    QAbstractSlider.SliderSingleStepSub  
    QAbstractSlider.SliderPageStepAdd  
    QAbstractSlider.SliderPageStepSub  
    QAbstractSlider.SliderToMinimum  
    QAbstractSlider.SliderToMaximum  
    QAbstractSlider.SliderMove  
    PySide.QtGui.QAbstractSlider. SliderChange
    常量 描述
    QAbstractSlider.SliderRangeChange  
    QAbstractSlider.SliderOrientationChange  
    QAbstractSlider.SliderStepsChange  
    QAbstractSlider.SliderValueChange  
    PySide.QtGui.QAbstractSlider. actionTriggered ( action )
    参数: action PySide.QtCore.int
    PySide.QtGui.QAbstractSlider. hasTracking ( )
    返回类型: 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.QtGui.QAbstractSlider. invertedAppearance ( )
    返回类型: 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 ( )
    返回类型: 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 ( )
    返回类型: 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 ( )
    返回类型: 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.QtGui.QAbstractSlider. minimum ( )
    返回类型: 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.QtGui.QAbstractSlider. orientation ( )
    返回类型: PySide.QtCore.Qt.Orientation

    This property holds the orientation of the slider.

    取向必须是 Qt.Vertical (默认) 或 Qt.Horizontal .

    PySide.QtGui.QAbstractSlider. pageStep ( )
    返回类型: PySide.QtCore.int

    This property holds the page step..

    抽象滑块提供 2 自然步幅的较大者,通常相当于用户按下 PageUp 或 PageDown。

    PySide.QtGui.QAbstractSlider. rangeChanged ( min , max )
    参数:
    • min PySide.QtCore.int
    • max PySide.QtCore.int
    PySide.QtGui.QAbstractSlider. repeatAction ( )
    返回类型: PySide.QtGui.QAbstractSlider.SliderAction

    返回当前的重复动作。

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

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

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

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

    PySide.QtGui.QAbstractSlider. setOrientation ( arg__1 )
    参数: arg__1 PySide.QtCore.Qt.Orientation

    This property holds the orientation of the slider.

    取向必须是 Qt.Vertical (默认) 或 Qt.Horizontal .

    PySide.QtGui.QAbstractSlider. setPageStep ( arg__1 )
    参数: arg__1 PySide.QtCore.int

    This property holds the page step..

    抽象滑块提供 2 自然步幅的较大者,通常相当于用户按下 PageUp 或 PageDown。

    PySide.QtGui.QAbstractSlider. setRange ( min , max )
    参数:
    • min PySide.QtCore.int
    • max PySide.QtCore.int

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

    max 小于 min , min 变为唯一合法值。

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

    设置动作 action to be triggered repetitively in intervals of repeatTime , after an initial delay of thresholdTime .

    PySide.QtGui.QAbstractSlider. setSingleStep ( arg__1 )
    参数: arg__1 PySide.QtCore.int

    This property holds the single step..

    抽象滑块提供 2 自然步幅的较小者,通常相当于用户按下箭头键。

    若在自动重复键事件期间修改特性,行为不确定。

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

    PySide.QtGui.QAbstractSlider. setSliderPosition ( arg__1 )
    参数: 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() .

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

    PySide.QtGui.QAbstractSlider. setValue ( arg__1 )
    参数: arg__1 PySide.QtCore.int

    This property holds the slider's current value.

    滑块将值强制在合法范围内: PySide.QtGui.QAbstractSlider.minimum() <= value <= PySide.QtGui.QAbstractSlider.maximum() .

    更改值也会改变 PySide.QtGui.QAbstractSlider.sliderPosition() .

    PySide.QtGui.QAbstractSlider. singleStep ( )
    返回类型: PySide.QtCore.int

    This property holds the single step..

    抽象滑块提供 2 自然步幅的较小者,通常相当于用户按下箭头键。

    若在自动重复键事件期间修改特性,行为不确定。

    PySide.QtGui.QAbstractSlider. sliderChange ( change )
    参数: 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 参数。

    PySide.QtGui.QAbstractSlider. sliderMoved ( position )
    参数: position PySide.QtCore.int
    PySide.QtGui.QAbstractSlider. sliderPosition ( )
    返回类型: PySide.QtCore.int

    This property holds the current slider position.

    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 )
    参数: action PySide.QtGui.QAbstractSlider.SliderAction

    触发滑块 action 。可能的动作是 SliderSingleStepAdd , SliderSingleStepSub , SliderPageStepAdd , SliderPageStepSub , SliderToMinimum , SliderToMaximum ,和 SliderMove .

    PySide.QtGui.QAbstractSlider. value ( )
    返回类型: PySide.QtCore.int

    This property holds the slider's current value.

    滑块将值强制在合法范围内: PySide.QtGui.QAbstractSlider.minimum() <= value <= PySide.QtGui.QAbstractSlider.maximum() .

    更改值也会改变 PySide.QtGui.QAbstractSlider.sliderPosition() .

    PySide.QtGui.QAbstractSlider. valueChanged ( value )
    参数: value PySide.QtCore.int