1 | // Copyright (C) 2021 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QCOLORAXIS_H |
5 | #define QCOLORAXIS_H |
6 | |
7 | #include <QtCharts/QAbstractAxis> |
8 | |
9 | QT_BEGIN_NAMESPACE |
10 | |
11 | class QColorAxisPrivate; |
12 | |
13 | class Q_CHARTS_EXPORT QColorAxis : public QAbstractAxis |
14 | { |
15 | Q_OBJECT |
16 | Q_PROPERTY(int tickCount READ tickCount WRITE setTickCount NOTIFY tickCountChanged) |
17 | Q_PROPERTY(qreal min READ min WRITE setMin NOTIFY minChanged) |
18 | Q_PROPERTY(qreal max READ max WRITE setMax NOTIFY maxChanged) |
19 | Q_PROPERTY(qreal size READ size WRITE setSize NOTIFY sizeChanged) |
20 | Q_PROPERTY(bool autoRange READ autoRange WRITE setAutoRange NOTIFY autoRangeChanged) |
21 | |
22 | public: |
23 | explicit QColorAxis(QObject *parent = nullptr); |
24 | ~QColorAxis(); |
25 | |
26 | AxisType type() const override; |
27 | |
28 | void setMin(qreal min); |
29 | qreal min() const; |
30 | void setMax(qreal max); |
31 | qreal max() const; |
32 | void setRange(qreal min, qreal max); |
33 | |
34 | void setTickCount(int count); |
35 | int tickCount() const; |
36 | |
37 | void setSize(const qreal size); |
38 | qreal size() const; |
39 | |
40 | void setGradient(const QLinearGradient &gradient); |
41 | QLinearGradient gradient() const; |
42 | |
43 | void setAutoRange(bool autoRange); |
44 | bool autoRange() const; |
45 | |
46 | Q_SIGNALS: |
47 | void minChanged(qreal min); |
48 | void maxChanged(qreal max); |
49 | void rangeChanged(qreal min, qreal max); |
50 | void tickCountChanged(int tickCount); |
51 | void gradientChanged(const QLinearGradient &gradient); |
52 | void sizeChanged(const qreal size); |
53 | void autoRangeChanged(bool autoRange); |
54 | |
55 | protected: |
56 | explicit QColorAxis(QColorAxisPrivate &d, QObject *parent = nullptr); |
57 | |
58 | private: |
59 | Q_DECLARE_PRIVATE(QColorAxis) |
60 | Q_DISABLE_COPY(QColorAxis) |
61 | }; |
62 | |
63 | QT_END_NAMESPACE |
64 | |
65 | #endif // QCOLORAXIS_H |
66 | |