def
initStyleOption
(option)
def
notchSize
()
def
notchTarget
()
def
notchesVisible
()
def
setNotchTarget
(target)
def
wrapping
()
def
setNotchesVisible
(visible)
def
setWrapping
(on)
![]()
QDialis used when the user needs to control a value within a program-definable range, and the range either wraps around (for example, with angles measured from 0 to 359 degrees) or the dialog layout needs a square widget.Since
QDial继承自QAbstractSlider, the dial behaves in a similar way to aslider。当wrapping()is false (the default setting) there is no real difference between a slider and a dial. They both share the same signals, slots and member functions. Which one you use depends on the expectations of your users and on the type of application.The dial initially emits
valueChanged()signals continuously while the slider is being moved; you can make it emit the signal less often by disabling thetrackingproperty. ThesliderMoved()signal is emitted continuously even when tracking is disabled.The dial also emits
sliderPressed()andsliderReleased()signals when the mouse button is pressed and released. Note that the dial’s value can change without these signals being emitted since the keyboard and wheel can also be used to change the value.Unlike the slider,
QDialattempts to draw a “nice” number of notches rather than one per line step. If possible, the number of notches drawn is one per line step, but if there aren’t enough pixels to draw every one,QDialwill skip notches to try and draw a uniform set (e.g. by drawing every second or third notch).Like the slider, the dial makes the
QAbstractSliderfunctionsetValue()available as a slot.The dial’s keyboard interface is fairly simple: The left/up and right/down arrow keys adjust the dial’s
valueby the definedsingleStep, Page Up and Page Down by the definedpageStep, and the Home and End keys set the value to the definedminimumandmaximum值。If you are using the mouse wheel to adjust the dial, the increment value is determined by the lesser value of
wheelScrollLinesmultipled bysingleStep,和pageStep.
QDial
(
[
parent=None
]
)
¶
- param parent
Constructs a dial.
parent
自变量被发送给
QAbstractSlider
构造函数。
PySide2.QtWidgets.QDial.
initStyleOption
(
option
)
¶
option
–
QStyleOptionSlider
初始化
option
采用值来自此
QDial
。此方法对子类是有用的,当需要
QStyleOptionSlider
, but don’t want to fill in all the information themselves.
另请参阅
PySide2.QtWidgets.QDial.
notchSize
(
)
¶
int
PySide2.QtWidgets.QDial.
notchTarget
(
)
¶
qreal
另请参阅
PySide2.QtWidgets.QDial.
notchesVisible
(
)
¶
bool
另请参阅
PySide2.QtWidgets.QDial.
setNotchTarget
(
target
)
¶
target
–
double
另请参阅
PySide2.QtWidgets.QDial.
setNotchesVisible
(
visible
)
¶
visible
–
bool
另请参阅
PySide2.QtWidgets.QDial.
setWrapping
(
on
)
¶
on
–
bool
另请参阅
PySide2.QtWidgets.QDial.
wrapping
(
)
¶
bool
另请参阅