Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qdial.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QDIAL_H
7#define QDIAL_H
8
9#include <QtWidgets/qtwidgetsglobal.h>
10
11#include <QtWidgets/qabstractslider.h>
12
14
15QT_BEGIN_NAMESPACE
16
17class QDialPrivate;
18class QStyleOptionSlider;
19
20class Q_WIDGETS_EXPORT QDial: public QAbstractSlider
21{
22 Q_OBJECT
23
24 Q_PROPERTY(bool wrapping READ wrapping WRITE setWrapping)
25 Q_PROPERTY(int notchSize READ notchSize)
26 Q_PROPERTY(qreal notchTarget READ notchTarget WRITE setNotchTarget)
27 Q_PROPERTY(bool notchesVisible READ notchesVisible WRITE setNotchesVisible)
28public:
29 explicit QDial(QWidget *parent = nullptr);
30
31 ~QDial();
32
33 bool wrapping() const;
34
35 int notchSize() const;
36
37 void setNotchTarget(double target);
38 qreal notchTarget() const;
39 bool notchesVisible() const;
40
41 QSize sizeHint() const override;
42 QSize minimumSizeHint() const override;
43
44public Q_SLOTS:
45 void setNotchesVisible(bool visible);
46 void setWrapping(bool on);
47
48protected:
49 bool event(QEvent *e) override;
50 void resizeEvent(QResizeEvent *re) override;
51 void paintEvent(QPaintEvent *pe) override;
52
53 void mousePressEvent(QMouseEvent *me) override;
54 void mouseReleaseEvent(QMouseEvent *me) override;
55 void mouseMoveEvent(QMouseEvent *me) override;
56
57 void sliderChange(SliderChange change) override;
58 virtual void initStyleOption(QStyleOptionSlider *option) const;
59
60
61private:
62 Q_DECLARE_PRIVATE(QDial)
63 Q_DISABLE_COPY(QDial)
64};
65
66QT_END_NAMESPACE
67
68#endif // QDIAL_H
uint wrapping
Definition qdial.cpp:41
uint doNotEmit
Definition qdial.cpp:42
virtual int bound(int val) const override
Definition qdial.cpp:57
void init()
Definition qdial.cpp:50
uint showNotches
Definition qdial.cpp:40
double angle(const QPoint &, const QPoint &) const
int valueFromPoint(const QPoint &) const
Definition qdial.cpp:107
The QDial class provides a rounded range control (like a speedometer or potentiometer).
Definition qdial.h:21
QT_REQUIRE_CONFIG(dial)