1// Copyright (C) 2016 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 <QtDataVisualization/qvalue3daxisformatter.h>
8
9QT_BEGIN_NAMESPACE
10
11class QLogValue3DAxisFormatterPrivate;
12
13class Q_DATAVISUALIZATION_EXPORT QLogValue3DAxisFormatter : public QValue3DAxisFormatter
14{
15 Q_OBJECT
16
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) const override;
45
46 QLogValue3DAxisFormatterPrivate *dptr();
47 const QLogValue3DAxisFormatterPrivate *dptrc() const;
48
49private:
50 Q_DISABLE_COPY(QLogValue3DAxisFormatter)
51
52 friend class QLogValue3DAxisFormatterPrivate;
53};
54
55QT_END_NAMESPACE
56
57#endif
58

source code of qtdatavis3d/src/datavisualization/axis/qlogvalue3daxisformatter.h