summaryrefslogtreecommitdiffstats
path: root/src/graphs3d/axis/qlogvalue3daxisformatter.h
blob: d6900e11e07423288240fbbfa3d67310a3d87232 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef QTGRAPHS_QLOGVALUE3DAXISFORMATTER_H
#define QTGRAPHS_QLOGVALUE3DAXISFORMATTER_H

#include <QtGraphs/qvalue3daxisformatter.h>

QT_BEGIN_NAMESPACE

class QLogValue3DAxisFormatterPrivate;

class Q_GRAPHS_EXPORT QLogValue3DAxisFormatter : public QValue3DAxisFormatter
{
    Q_OBJECT
    Q_DECLARE_PRIVATE(QLogValue3DAxisFormatter)
    Q_PROPERTY(qreal base READ base WRITE setBase NOTIFY baseChanged FINAL)
    Q_PROPERTY(bool autoSubGrid READ autoSubGrid WRITE setAutoSubGrid NOTIFY autoSubGridChanged FINAL)
    Q_PROPERTY(bool edgeLabelsVisible READ edgeLabelsVisible WRITE setEdgeLabelsVisible NOTIFY
                   edgeLabelsVisibleChanged FINAL)
    QML_NAMED_ELEMENT(LogValue3DAxisFormatter)

protected:
    explicit QLogValue3DAxisFormatter(QLogValue3DAxisFormatterPrivate &d, QObject *parent = nullptr);

public:
    explicit QLogValue3DAxisFormatter(QObject *parent = nullptr);
    ~QLogValue3DAxisFormatter() override;

    void setBase(qreal base);
    qreal base() const;
    void setAutoSubGrid(bool enabled);
    bool autoSubGrid() const;
    void setEdgeLabelsVisible(bool enabled);
    bool edgeLabelsVisible() const;

Q_SIGNALS:
    void baseChanged(qreal base);
    void autoSubGridChanged(bool enabled);
    void edgeLabelsVisibleChanged(bool enabled);

protected:
    QValue3DAxisFormatter *createNewInstance() const override;
    void recalculate() override;
    float positionAt(float value) const override;
    float valueAt(float position) const override;
    void populateCopy(QValue3DAxisFormatter &copy) override;

private:
    Q_DISABLE_COPY(QLogValue3DAxisFormatter)
};

QT_END_NAMESPACE

#endif