1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QTGRAPHS_QLOGVALUE3DAXISFORMATTER_H
5#define QTGRAPHS_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 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 QML_NAMED_ELEMENT(LogValue3DAxisFormatter)
22
23protected:
24 explicit QLogValue3DAxisFormatter(QLogValue3DAxisFormatterPrivate &d, QObject *parent = nullptr);
25
26public:
27 explicit QLogValue3DAxisFormatter(QObject *parent = nullptr);
28 ~QLogValue3DAxisFormatter() override;
29
30 void setBase(qreal base);
31 qreal base() const;
32 void setAutoSubGrid(bool enabled);
33 bool autoSubGrid() const;
34 void setEdgeLabelsVisible(bool enabled);
35 bool edgeLabelsVisible() const;
36
37Q_SIGNALS:
38 void baseChanged(qreal base);
39 void autoSubGridChanged(bool enabled);
40 void edgeLabelsVisibleChanged(bool enabled);
41
42protected:
43 QValue3DAxisFormatter *createNewInstance() const override;
44 void recalculate() override;
45 float positionAt(float value) const override;
46 float valueAt(float position) const override;
47 void populateCopy(QValue3DAxisFormatter &copy) override;
48
49private:
50 Q_DISABLE_COPY(QLogValue3DAxisFormatter)
51};
52
53QT_END_NAMESPACE
54
55#endif
56

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