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
9QT_BEGIN_NAMESPACE
10
11class QLogValue3DAxisFormatterPrivate;
12
13class 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
21protected:
22 explicit QLogValue3DAxisFormatter(QLogValue3DAxisFormatterPrivate *d, QObject *parent = nullptr);
23public:
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
34Q_SIGNALS:
35 void baseChanged(qreal base);
36 void autoSubGridChanged(bool enabled);
37 void showEdgeLabelsChanged(bool enabled);
38
39protected:
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 &copy) override;
45
46private:
47 Q_DISABLE_COPY(QLogValue3DAxisFormatter)
48};
49
50QT_END_NAMESPACE
51
52#endif
53

source code of qtgraphs/src/graphs/axis/qlogvalue3daxisformatter.h