1 | // Copyright (C) 2023 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QLOGVALUE3DAXISFORMATTER_H |
5 | #define QLOGVALUE3DAXISFORMATTER_H |
6 | |
7 | #include <QtGraphs/qvalue3daxisformatter.h> |
8 | |
9 | QT_BEGIN_NAMESPACE |
10 | |
11 | class QLogValue3DAxisFormatterPrivate; |
12 | |
13 | class Q_GRAPHS_EXPORT QLogValue3DAxisFormatter : public QValue3DAxisFormatter |
14 | { |
15 | Q_OBJECT |
16 | Q_DECLARE_PRIVATE(QLogValue3DAxisFormatter) |
17 | Q_PROPERTY(qreal base READ base WRITE setBase NOTIFY baseChanged) |
18 | Q_PROPERTY(bool autoSubGrid READ autoSubGrid WRITE setAutoSubGrid NOTIFY autoSubGridChanged) |
19 | Q_PROPERTY(bool showEdgeLabels READ showEdgeLabels WRITE setShowEdgeLabels NOTIFY showEdgeLabelsChanged) |
20 | |
21 | protected: |
22 | explicit QLogValue3DAxisFormatter(QLogValue3DAxisFormatterPrivate *d, QObject *parent = nullptr); |
23 | public: |
24 | explicit QLogValue3DAxisFormatter(QObject *parent = nullptr); |
25 | virtual ~QLogValue3DAxisFormatter(); |
26 | |
27 | void setBase(qreal base); |
28 | qreal base() const; |
29 | void setAutoSubGrid(bool enabled); |
30 | bool autoSubGrid() const; |
31 | void setShowEdgeLabels(bool enabled); |
32 | bool showEdgeLabels() const; |
33 | |
34 | Q_SIGNALS: |
35 | void baseChanged(qreal base); |
36 | void autoSubGridChanged(bool enabled); |
37 | void showEdgeLabelsChanged(bool enabled); |
38 | |
39 | protected: |
40 | QValue3DAxisFormatter *createNewInstance() const override; |
41 | void recalculate() override; |
42 | float positionAt(float value) const override; |
43 | float valueAt(float position) const override; |
44 | void populateCopy(QValue3DAxisFormatter ©) override; |
45 | |
46 | private: |
47 | Q_DISABLE_COPY(QLogValue3DAxisFormatter) |
48 | }; |
49 | |
50 | QT_END_NAMESPACE |
51 | |
52 | #endif |
53 |