1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4// W A R N I N G
5// -------------
6//
7// This file is not part of the Qt Chart API. It exists purely as an
8// implementation detail. This header file may change from version to
9// version without notice, or even be removed.
10//
11// We mean it.
12
13#ifndef DECLARATIVEAXES_H
14#define DECLARATIVEAXES_H
15
16#include <QtQml/qqmlregistration.h>
17#include <QtCharts/qabstractaxis.h>
18#include <QtCore/QObject>
19#include <private/declarativechartglobal_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class Q_CHARTSQML_PRIVATE_EXPORT DeclarativeAxes : public QObject
24{
25 Q_OBJECT
26 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
27 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
28 Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged)
29 Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged)
30 QML_NAMED_ELEMENT(DeclarativeAxes)
31 QML_ADDED_IN_VERSION(1, 0)
32 QML_EXTRA_VERSION(2, 0)
33 QML_UNCREATABLE("Abstract base type")
34
35public:
36 explicit DeclarativeAxes(QObject *parent = 0);
37
38 QAbstractAxis *axisX() { return m_axisX; }
39 void setAxisX(QAbstractAxis *axis);
40 QAbstractAxis *axisY() { return m_axisY; }
41 void setAxisY(QAbstractAxis *axis);
42 QAbstractAxis *axisXTop() { return m_axisXTop; }
43 void setAxisXTop(QAbstractAxis *axis);
44 QAbstractAxis *axisYRight() { return m_axisYRight; }
45 void setAxisYRight(QAbstractAxis *axis);
46
47public:
48 void emitAxisXChanged() { emit axisXChanged(axis: m_axisX); }
49 void emitAxisYChanged() { emit axisYChanged(axis: m_axisY); }
50 void emitAxisXTopChanged() { emit axisXTopChanged(axis: m_axisXTop); }
51 void emitAxisYRightChanged() { emit axisYRightChanged(axis: m_axisYRight); }
52
53Q_SIGNALS:
54 void axisXChanged(QAbstractAxis *axis);
55 void axisYChanged(QAbstractAxis *axis);
56 void axisXTopChanged(QAbstractAxis *axis);
57 void axisYRightChanged(QAbstractAxis *axis);
58
59private:
60 QAbstractAxis *m_axisX;
61 QAbstractAxis *m_axisY;
62 QAbstractAxis *m_axisXTop;
63 QAbstractAxis *m_axisYRight;
64};
65
66QT_END_NAMESPACE
67
68#endif // DECLARATIVEAXES_H
69

source code of qtcharts/src/chartsqml2/declarativeaxes_p.h