QDial is 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.
QDial inherits from
QAbstractSlider , the dial behaves in a similar way to a
slider . When
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 the
tracking property. The
sliderMoved() signal is emitted continuously even when tracking is disabled.
The dial also emits and 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,
QDial attempts 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,
QDial will skip notches to try and draw a uniform set (e.g. by drawing every second or third notch).
The dial’s keyboard interface is fairly simple: The left/up and right/down arrow keys adjust the dial’s
value by the defined
singleStep , Page Up and Page Down by the defined
pageStep , and the Home and End keys set the value to the defined
Constructs a dial.
parent argument is sent to the
- Return type
visible – bool
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.