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 FINAL) |
18 | Q_PROPERTY(bool autoSubGrid READ autoSubGrid WRITE setAutoSubGrid NOTIFY autoSubGridChanged FINAL) |
19 | Q_PROPERTY(bool edgeLabelsVisible READ edgeLabelsVisible WRITE setEdgeLabelsVisible NOTIFY |
20 | edgeLabelsVisibleChanged FINAL) |
21 | |
22 | protected: |
23 | explicit QLogValue3DAxisFormatter(QLogValue3DAxisFormatterPrivate &d, QObject *parent = nullptr); |
24 | |
25 | public: |
26 | explicit QLogValue3DAxisFormatter(QObject *parent = nullptr); |
27 | ~QLogValue3DAxisFormatter() override; |
28 | |
29 | void setBase(qreal base); |
30 | qreal base() const; |
31 | void setAutoSubGrid(bool enabled); |
32 | bool autoSubGrid() const; |
33 | void setEdgeLabelsVisible(bool enabled); |
34 | bool edgeLabelsVisible() const; |
35 | |
36 | Q_SIGNALS: |
37 | void baseChanged(qreal base); |
38 | void autoSubGridChanged(bool enabled); |
39 | void edgeLabelsVisibleChanged(bool enabled); |
40 | |
41 | protected: |
42 | QValue3DAxisFormatter *createNewInstance() const override; |
43 | void recalculate() override; |
44 | float positionAt(float value) const override; |
45 | float valueAt(float position) const override; |
46 | void populateCopy(QValue3DAxisFormatter ©) override; |
47 | |
48 | private: |
49 | Q_DISABLE_COPY(QLogValue3DAxisFormatter) |
50 | }; |
51 | |
52 | QT_END_NAMESPACE |
53 | |
54 | #endif |
55 |