1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QLOGVALUEAXIS_H |
5 | #define QLOGVALUEAXIS_H |
6 | |
7 | #include <QtCharts/QAbstractAxis> |
8 | |
9 | QT_BEGIN_NAMESPACE |
10 | class QDateTime; |
11 | QT_END_NAMESPACE |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | class QLogValueAxisPrivate; |
16 | |
17 | class Q_CHARTS_EXPORT QLogValueAxis : public QAbstractAxis |
18 | { |
19 | Q_OBJECT |
20 | Q_PROPERTY(qreal min READ min WRITE setMin NOTIFY minChanged) |
21 | Q_PROPERTY(qreal max READ max WRITE setMax NOTIFY maxChanged) |
22 | Q_PROPERTY(QString labelFormat READ labelFormat WRITE setLabelFormat NOTIFY labelFormatChanged) |
23 | Q_PROPERTY(qreal base READ base WRITE setBase NOTIFY baseChanged) |
24 | Q_PROPERTY(int tickCount READ tickCount NOTIFY tickCountChanged) |
25 | Q_PROPERTY(int minorTickCount READ minorTickCount WRITE setMinorTickCount NOTIFY minorTickCountChanged) |
26 | |
27 | public: |
28 | explicit QLogValueAxis(QObject *parent = nullptr); |
29 | ~QLogValueAxis(); |
30 | |
31 | protected: |
32 | QLogValueAxis(QLogValueAxisPrivate &d, QObject *parent = nullptr); |
33 | |
34 | public: |
35 | AxisType type() const override; |
36 | |
37 | //range handling |
38 | void setMin(qreal min); |
39 | qreal min() const; |
40 | void setMax(qreal max); |
41 | qreal max() const; |
42 | void setRange(qreal min, qreal max); |
43 | |
44 | void setLabelFormat(const QString &format); |
45 | QString labelFormat() const; |
46 | |
47 | void setBase(qreal base); |
48 | qreal base() const; |
49 | |
50 | int tickCount() const; |
51 | |
52 | void setMinorTickCount(int minorTickCount); |
53 | int minorTickCount() const; |
54 | |
55 | Q_SIGNALS: |
56 | void minChanged(qreal min); |
57 | void maxChanged(qreal max); |
58 | void rangeChanged(qreal min, qreal max); |
59 | void labelFormatChanged(const QString &format); |
60 | void baseChanged(qreal base); |
61 | void tickCountChanged(int tickCount); |
62 | void minorTickCountChanged(int minorTickCount); |
63 | |
64 | private: |
65 | Q_DECLARE_PRIVATE(QLogValueAxis) |
66 | Q_DISABLE_COPY(QLogValueAxis) |
67 | }; |
68 | |
69 | QT_END_NAMESPACE |
70 | |
71 | #endif // QLOGVALUEAXIS_H |
72 | |