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 DECLARATIVEAREASERIES_H |
14 | #define DECLARATIVEAREASERIES_H |
15 | |
16 | #include <QtCharts/QAreaSeries> |
17 | #include <QtQml/qqmlregistration.h> |
18 | #include <private/declarativechartglobal_p.h> |
19 | #include <private/declarativeaxes_p.h> |
20 | #include <private/declarativelineseries_p.h> |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class Q_CHARTSQML_PRIVATE_EXPORT DeclarativeAreaSeries : public QAreaSeries |
25 | { |
26 | Q_OBJECT |
27 | Q_PROPERTY(DeclarativeLineSeries *upperSeries READ upperSeries WRITE setUpperSeries) |
28 | Q_PROPERTY(DeclarativeLineSeries *lowerSeries READ lowerSeries WRITE setLowerSeries) |
29 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION(1, 1)) |
30 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION(1, 1)) |
31 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION(1, 2)) |
32 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION(1, 2)) |
33 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION(1, 3)) |
34 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION(1, 3)) |
35 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION(1, 1)) |
36 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION(1, 4)) |
37 | Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged REVISION(1, 4)) |
38 | QML_NAMED_ELEMENT(AreaSeries) |
39 | QML_ADDED_IN_VERSION(1, 0) |
40 | QML_EXTRA_VERSION(2, 0) |
41 | |
42 | public: |
43 | explicit DeclarativeAreaSeries(QObject *parent = 0); |
44 | void setUpperSeries(DeclarativeLineSeries *series); |
45 | DeclarativeLineSeries *upperSeries() const; |
46 | void setLowerSeries(DeclarativeLineSeries *series); |
47 | DeclarativeLineSeries *lowerSeries() const; |
48 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
49 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
50 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
51 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
52 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } |
53 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } |
54 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } |
55 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } |
56 | QAbstractAxis *axisAngular() { return m_axes->axisX(); } |
57 | void setAxisAngular(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
58 | QAbstractAxis *axisRadial() { return m_axes->axisY(); } |
59 | void setAxisRadial(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
60 | qreal borderWidth() const; |
61 | void setBorderWidth(qreal borderWidth); |
62 | QString brushFilename() const; |
63 | void setBrushFilename(const QString &brushFilename); |
64 | void setBrush(const QBrush &brush); |
65 | QBrush brush() const; |
66 | |
67 | Q_SIGNALS: |
68 | Q_REVISION(1, 1) void axisXChanged(QAbstractAxis *axis); |
69 | Q_REVISION(1, 1) void axisYChanged(QAbstractAxis *axis); |
70 | Q_REVISION(1, 1) void borderWidthChanged(qreal width); |
71 | Q_REVISION(1, 2) void axisXTopChanged(QAbstractAxis *axis); |
72 | Q_REVISION(1, 2) void axisYRightChanged(QAbstractAxis *axis); |
73 | Q_REVISION(1, 3) void axisAngularChanged(QAbstractAxis *axis); |
74 | Q_REVISION(1, 3) void axisRadialChanged(QAbstractAxis *axis); |
75 | Q_REVISION(1, 4) void brushChanged(); |
76 | Q_REVISION(1, 4) void brushFilenameChanged(const QString &brushFilename); |
77 | |
78 | private Q_SLOTS: |
79 | void handleBrushChanged(); |
80 | |
81 | public: |
82 | DeclarativeAxes *m_axes; |
83 | |
84 | private: |
85 | QString m_brushFilename; |
86 | QImage m_brushImage; |
87 | }; |
88 | |
89 | QT_END_NAMESPACE |
90 | |
91 | #endif // DECLARATIVEAREASERIES_H |
92 | |