|qmake:||QT += widgets|
- 11 properties inherited from QAbstractSlider
- 59 properties inherited from QWidget
- 1 property inherited from QObject
|QDial(QWidget *parent = Q_NULLPTR)|
- 21 public functions inherited from QAbstractSlider
- 214 public functions inherited from QWidget
- 32 public functions inherited from QObject
- 14 public functions inherited from QPaintDevice
- 3 public slots inherited from QAbstractSlider
- 19 public slots inherited from QWidget
- 1 public slot inherited from QObject
|void||initStyleOption(QStyleOptionSlider *option) const|
|virtual bool||event(QEvent *e)|
|virtual void||mouseMoveEvent(QMouseEvent *e)|
|virtual void||mousePressEvent(QMouseEvent *e)|
|virtual void||mouseReleaseEvent(QMouseEvent *e)|
|virtual void||paintEvent(QPaintEvent *pe)|
|virtual void||resizeEvent(QResizeEvent *e)|
|virtual void||sliderChange(SliderChange change)|
- 8 protected functions inherited from QAbstractSlider
- 35 protected functions inherited from QWidget
- 9 protected functions inherited from QObject
- 1 protected function inherited from QPaintDevice
Additional Inherited Members
- 6 signals inherited from QAbstractSlider
- 3 signals inherited from QWidget
- 2 signals inherited from QObject
- 5 static public members inherited from QWidget
- 11 static public members inherited from QObject
- 1 protected slot inherited from QWidget
The QDial class provides a rounded range control (like a speedometer or potentiometer).
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.
Since 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 sliderPressed() and sliderReleased() 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 minimum and maximum values.
This property holds the current notch size
By default, this property has a value of 1.
notchTarget : qreal
This property holds the target number of pixels between notches
The notch target is the number of pixels QDial attempts to put between each notch.
The actual size may differ from the target size.
The default notch target is 3.7 pixels.
This property holds whether the notches are shown
If the property is
true, a series of notches are drawn around the dial to indicate the range of values available; otherwise no notches are shown.
By default, this property is disabled.
This property holds whether wrapping is enabled
If true, wrapping is enabled; otherwise some space is inserted at the bottom of the dial to separate the ends of the range of valid values.
If enabled, the arrow can be oriented at any angle on the dial. If disabled, the arrow will be restricted to the upper part of the dial; if it is rotated into the space at the bottom of the dial, it will be clamped to the closest end of the valid range of values.
By default this property is
Member Function Documentation
QDial::QDial(QWidget *parent = Q_NULLPTR)
Constructs a dial.
The parent argument is sent to the QAbstractSlider constructor.
Destroys the dial.
[virtual protected] bool QDial::event(QEvent *e)
Reimplemented from QObject::event().
[protected] void QDial::initStyleOption(QStyleOptionSlider *option) const
See also QStyleOption::initFrom().
[virtual] QSize QDial::minimumSizeHint() const
Reimplemented from QWidget::minimumSizeHint().
[virtual protected] void QDial::mouseMoveEvent(QMouseEvent *e)
Reimplemented from QWidget::mouseMoveEvent().
[virtual protected] void QDial::mousePressEvent(QMouseEvent *e)
Reimplemented from QWidget::mousePressEvent().
[virtual protected] void QDial::mouseReleaseEvent(QMouseEvent *e)
Reimplemented from QWidget::mouseReleaseEvent().
[virtual protected] void QDial::paintEvent(QPaintEvent *pe)
Reimplemented from QWidget::paintEvent().
[virtual protected] void QDial::resizeEvent(QResizeEvent *e)
Reimplemented from QWidget::resizeEvent().
[virtual] QSize QDial::sizeHint() const
Reimplemented from QWidget::sizeHint().
[virtual protected] void QDial::sliderChange(SliderChange change)
Reimplemented from QAbstractSlider::sliderChange().
© 2020 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.