@@ -1,94 +1,94 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2014 Digia Plc |
|
3 | ** Copyright (C) 2014 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVEAREASERIES_H |
|
21 | #ifndef DECLARATIVEAREASERIES_H | |
22 | #define DECLARATIVEAREASERIES_H |
|
22 | #define DECLARATIVEAREASERIES_H | |
23 |
|
23 | |||
24 | #include <QtCharts/QAreaSeries> |
|
24 | #include <QtCharts/QAreaSeries> | |
25 | #include "declarativeaxes.h" |
|
25 | #include "declarativeaxes.h" | |
26 |
|
26 | |||
27 | QT_CHARTS_BEGIN_NAMESPACE |
|
27 | QT_CHARTS_BEGIN_NAMESPACE | |
28 | class DeclarativeLineSeries; |
|
28 | class DeclarativeLineSeries; | |
29 |
|
29 | |||
30 | class DeclarativeAreaSeries : public QAreaSeries |
|
30 | class DeclarativeAreaSeries : public QAreaSeries | |
31 | { |
|
31 | { | |
32 | Q_OBJECT |
|
32 | Q_OBJECT | |
33 | Q_PROPERTY(DeclarativeLineSeries *upperSeries READ upperSeries WRITE setUpperSeries) |
|
33 | Q_PROPERTY(DeclarativeLineSeries *upperSeries READ upperSeries WRITE setUpperSeries) | |
34 | Q_PROPERTY(DeclarativeLineSeries *lowerSeries READ lowerSeries WRITE setLowerSeries) |
|
34 | Q_PROPERTY(DeclarativeLineSeries *lowerSeries READ lowerSeries WRITE setLowerSeries) | |
35 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
35 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
36 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
36 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
37 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
37 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
38 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
38 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
39 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) |
|
39 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) | |
40 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) |
|
40 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) | |
41 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) |
|
41 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) | |
42 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION 4) |
|
42 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION 4) | |
43 | Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged REVISION 4) |
|
43 | Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged REVISION 4) | |
44 |
|
44 | |||
45 | public: |
|
45 | public: | |
46 | explicit DeclarativeAreaSeries(QObject *parent = 0); |
|
46 | explicit DeclarativeAreaSeries(QObject *parent = 0); | |
47 | void setUpperSeries(DeclarativeLineSeries *series); |
|
47 | void setUpperSeries(DeclarativeLineSeries *series); | |
48 | DeclarativeLineSeries *upperSeries() const; |
|
48 | DeclarativeLineSeries *upperSeries() const; | |
49 | void setLowerSeries(DeclarativeLineSeries *series); |
|
49 | void setLowerSeries(DeclarativeLineSeries *series); | |
50 | DeclarativeLineSeries *lowerSeries() const; |
|
50 | DeclarativeLineSeries *lowerSeries() const; | |
51 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
51 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
52 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
52 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
53 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
53 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
54 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
54 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
55 |
|
|
55 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
56 |
|
|
56 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
57 |
|
|
57 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
58 |
|
|
58 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
59 |
|
|
59 | QAbstractAxis *axisAngular() { return m_axes->axisX(); } | |
60 |
|
|
60 | void setAxisAngular(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
61 |
|
|
61 | QAbstractAxis *axisRadial() { return m_axes->axisY(); } | |
62 |
|
|
62 | void setAxisRadial(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
63 | qreal borderWidth() const; |
|
63 | qreal borderWidth() const; | |
64 | void setBorderWidth(qreal borderWidth); |
|
64 | void setBorderWidth(qreal borderWidth); | |
65 | QString brushFilename() const; |
|
65 | QString brushFilename() const; | |
66 | void setBrushFilename(const QString &brushFilename); |
|
66 | void setBrushFilename(const QString &brushFilename); | |
67 | void setBrush(const QBrush &brush); |
|
67 | void setBrush(const QBrush &brush); | |
68 | QBrush brush() const; |
|
68 | QBrush brush() const; | |
69 |
|
69 | |||
70 | Q_SIGNALS: |
|
70 | Q_SIGNALS: | |
71 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
71 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
72 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
72 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
73 | Q_REVISION(1) void borderWidthChanged(qreal width); |
|
73 | Q_REVISION(1) void borderWidthChanged(qreal width); | |
74 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
74 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
75 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
75 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
76 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); |
|
76 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); | |
77 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); |
|
77 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); | |
78 | Q_REVISION(4) void brushChanged(); |
|
78 | Q_REVISION(4) void brushChanged(); | |
79 | Q_REVISION(4) void brushFilenameChanged(const QString &brushFilename); |
|
79 | Q_REVISION(4) void brushFilenameChanged(const QString &brushFilename); | |
80 |
|
80 | |||
81 | private Q_SLOTS: |
|
81 | private Q_SLOTS: | |
82 | void handleBrushChanged(); |
|
82 | void handleBrushChanged(); | |
83 |
|
83 | |||
84 | public: |
|
84 | public: | |
85 | DeclarativeAxes *m_axes; |
|
85 | DeclarativeAxes *m_axes; | |
86 |
|
86 | |||
87 | private: |
|
87 | private: | |
88 | QString m_brushFilename; |
|
88 | QString m_brushFilename; | |
89 | QImage m_brushImage; |
|
89 | QImage m_brushImage; | |
90 | }; |
|
90 | }; | |
91 |
|
91 | |||
92 | QT_CHARTS_END_NAMESPACE |
|
92 | QT_CHARTS_END_NAMESPACE | |
93 |
|
93 | |||
94 | #endif // DECLARATIVEAREASERIES_H |
|
94 | #endif // DECLARATIVEAREASERIES_H |
@@ -1,361 +1,361 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2014 Digia Plc |
|
3 | ** Copyright (C) 2014 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVEBARSERIES_H |
|
21 | #ifndef DECLARATIVEBARSERIES_H | |
22 | #define DECLARATIVEBARSERIES_H |
|
22 | #define DECLARATIVEBARSERIES_H | |
23 |
|
23 | |||
24 | #include <QtCharts/QBarSeries> |
|
24 | #include <QtCharts/QBarSeries> | |
25 | #include <QtCharts/QStackedBarSeries> |
|
25 | #include <QtCharts/QStackedBarSeries> | |
26 | #include <QtCharts/QPercentBarSeries> |
|
26 | #include <QtCharts/QPercentBarSeries> | |
27 | #include <QtCharts/QHorizontalBarSeries> |
|
27 | #include <QtCharts/QHorizontalBarSeries> | |
28 | #include <QtCharts/QHorizontalStackedBarSeries> |
|
28 | #include <QtCharts/QHorizontalStackedBarSeries> | |
29 | #include <QtCharts/QHorizontalPercentBarSeries> |
|
29 | #include <QtCharts/QHorizontalPercentBarSeries> | |
30 | #include <QtCharts/QBarSet> |
|
30 | #include <QtCharts/QBarSet> | |
31 | #include "declarativeaxes.h" |
|
31 | #include "declarativeaxes.h" | |
32 |
|
32 | |||
33 | #include <QtQuick/QQuickItem> |
|
33 | #include <QtQuick/QQuickItem> | |
34 | #include <QtQml/QQmlParserStatus> |
|
34 | #include <QtQml/QQmlParserStatus> | |
35 |
|
35 | |||
36 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | QT_CHARTS_BEGIN_NAMESPACE | |
37 |
|
37 | |||
38 | class QChart; |
|
38 | class QChart; | |
39 |
|
39 | |||
40 | class DeclarativeBarSet : public QBarSet |
|
40 | class DeclarativeBarSet : public QBarSet | |
41 | { |
|
41 | { | |
42 | Q_OBJECT |
|
42 | Q_OBJECT | |
43 | Q_PROPERTY(QVariantList values READ values WRITE setValues) |
|
43 | Q_PROPERTY(QVariantList values READ values WRITE setValues) | |
44 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) |
|
44 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) | |
45 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
45 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
46 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION 2) |
|
46 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION 2) | |
47 |
|
47 | |||
48 | public: |
|
48 | public: | |
49 | explicit DeclarativeBarSet(QObject *parent = 0); |
|
49 | explicit DeclarativeBarSet(QObject *parent = 0); | |
50 | QVariantList values(); |
|
50 | QVariantList values(); | |
51 | void setValues(QVariantList values); |
|
51 | void setValues(QVariantList values); | |
52 | qreal borderWidth() const; |
|
52 | qreal borderWidth() const; | |
53 | void setBorderWidth(qreal borderWidth); |
|
53 | void setBorderWidth(qreal borderWidth); | |
54 | QString brushFilename() const; |
|
54 | QString brushFilename() const; | |
55 | void setBrushFilename(const QString &brushFilename); |
|
55 | void setBrushFilename(const QString &brushFilename); | |
56 |
|
56 | |||
57 | public: // From QBarSet |
|
57 | public: // From QBarSet | |
58 | Q_INVOKABLE void append(qreal value) { QBarSet::append(value); } |
|
58 | Q_INVOKABLE void append(qreal value) { QBarSet::append(value); } | |
59 | Q_INVOKABLE void remove(const int index, const int count = 1) { QBarSet::remove(index, count); } |
|
59 | Q_INVOKABLE void remove(const int index, const int count = 1) { QBarSet::remove(index, count); } | |
60 | Q_INVOKABLE void replace(int index, qreal value) { QBarSet::replace(index, value); } |
|
60 | Q_INVOKABLE void replace(int index, qreal value) { QBarSet::replace(index, value); } | |
61 | Q_INVOKABLE qreal at(int index) { return QBarSet::at(index); } |
|
61 | Q_INVOKABLE qreal at(int index) { return QBarSet::at(index); } | |
62 |
|
62 | |||
63 | Q_SIGNALS: |
|
63 | Q_SIGNALS: | |
64 | void countChanged(int count); |
|
64 | void countChanged(int count); | |
65 | Q_REVISION(1) void borderWidthChanged(qreal width); |
|
65 | Q_REVISION(1) void borderWidthChanged(qreal width); | |
66 | Q_REVISION(2) void brushFilenameChanged(const QString &brushFilename); |
|
66 | Q_REVISION(2) void brushFilenameChanged(const QString &brushFilename); | |
67 |
|
67 | |||
68 | private Q_SLOTS: |
|
68 | private Q_SLOTS: | |
69 | void handleCountChanged(int index, int count); |
|
69 | void handleCountChanged(int index, int count); | |
70 | void handleBrushChanged(); |
|
70 | void handleBrushChanged(); | |
71 |
|
71 | |||
72 | private: |
|
72 | private: | |
73 | QString m_brushFilename; |
|
73 | QString m_brushFilename; | |
74 | QImage m_brushImage; |
|
74 | QImage m_brushImage; | |
75 | }; |
|
75 | }; | |
76 |
|
76 | |||
77 | class DeclarativeBarSeries : public QBarSeries, public QQmlParserStatus |
|
77 | class DeclarativeBarSeries : public QBarSeries, public QQmlParserStatus | |
78 | { |
|
78 | { | |
79 | Q_OBJECT |
|
79 | Q_OBJECT | |
80 | Q_INTERFACES(QQmlParserStatus) |
|
80 | Q_INTERFACES(QQmlParserStatus) | |
81 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
81 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
82 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
82 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
83 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
83 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
84 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
84 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
85 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
85 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
86 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
86 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
87 |
|
87 | |||
88 | public: |
|
88 | public: | |
89 | explicit DeclarativeBarSeries(QQuickItem *parent = 0); |
|
89 | explicit DeclarativeBarSeries(QQuickItem *parent = 0); | |
90 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
90 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
91 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
91 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
92 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
92 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
93 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
93 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
94 |
|
|
94 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
95 |
|
|
95 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
96 |
|
|
96 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
97 |
|
|
97 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
98 | QQmlListProperty<QObject> seriesChildren(); |
|
98 | QQmlListProperty<QObject> seriesChildren(); | |
99 |
|
99 | |||
100 | public: |
|
100 | public: | |
101 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
101 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
102 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
102 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
103 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
103 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
104 | Q_INVOKABLE bool remove(QBarSet *barset) { return QBarSeries::remove(barset); } |
|
104 | Q_INVOKABLE bool remove(QBarSet *barset) { return QBarSeries::remove(barset); } | |
105 | Q_INVOKABLE void clear() { return QBarSeries::clear(); } |
|
105 | Q_INVOKABLE void clear() { return QBarSeries::clear(); } | |
106 |
|
106 | |||
107 | public: // from QDeclarativeParserStatus |
|
107 | public: // from QDeclarativeParserStatus | |
108 | void classBegin(); |
|
108 | void classBegin(); | |
109 | void componentComplete(); |
|
109 | void componentComplete(); | |
110 |
|
110 | |||
111 | Q_SIGNALS: |
|
111 | Q_SIGNALS: | |
112 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
112 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
113 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
113 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
114 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
114 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
115 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
115 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
116 |
|
116 | |||
117 | public Q_SLOTS: |
|
117 | public Q_SLOTS: | |
118 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); |
|
118 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); | |
119 |
|
119 | |||
120 | public: |
|
120 | public: | |
121 | DeclarativeAxes *m_axes; |
|
121 | DeclarativeAxes *m_axes; | |
122 | }; |
|
122 | }; | |
123 |
|
123 | |||
124 | class DeclarativeStackedBarSeries : public QStackedBarSeries, public QQmlParserStatus |
|
124 | class DeclarativeStackedBarSeries : public QStackedBarSeries, public QQmlParserStatus | |
125 | { |
|
125 | { | |
126 | Q_OBJECT |
|
126 | Q_OBJECT | |
127 | Q_INTERFACES(QQmlParserStatus) |
|
127 | Q_INTERFACES(QQmlParserStatus) | |
128 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
128 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
129 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
129 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
130 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
130 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
131 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
131 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
132 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
132 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
133 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
133 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
134 |
|
134 | |||
135 | public: |
|
135 | public: | |
136 | explicit DeclarativeStackedBarSeries(QQuickItem *parent = 0); |
|
136 | explicit DeclarativeStackedBarSeries(QQuickItem *parent = 0); | |
137 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
137 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
138 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
138 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
139 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
139 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
140 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
140 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
141 |
|
|
141 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
142 |
|
|
142 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
143 |
|
|
143 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
144 |
|
|
144 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
145 | QQmlListProperty<QObject> seriesChildren(); |
|
145 | QQmlListProperty<QObject> seriesChildren(); | |
146 |
|
146 | |||
147 | public: |
|
147 | public: | |
148 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
148 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
149 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
149 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
150 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
150 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
151 | Q_INVOKABLE bool remove(QBarSet *barset) { return QStackedBarSeries::remove(barset); } |
|
151 | Q_INVOKABLE bool remove(QBarSet *barset) { return QStackedBarSeries::remove(barset); } | |
152 | Q_INVOKABLE void clear() { return QStackedBarSeries::clear(); } |
|
152 | Q_INVOKABLE void clear() { return QStackedBarSeries::clear(); } | |
153 |
|
153 | |||
154 | public: // from QDeclarativeParserStatus |
|
154 | public: // from QDeclarativeParserStatus | |
155 | void classBegin(); |
|
155 | void classBegin(); | |
156 | void componentComplete(); |
|
156 | void componentComplete(); | |
157 |
|
157 | |||
158 | Q_SIGNALS: |
|
158 | Q_SIGNALS: | |
159 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
159 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
160 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
160 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
161 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
161 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
162 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
162 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
163 |
|
163 | |||
164 | public Q_SLOTS: |
|
164 | public Q_SLOTS: | |
165 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); |
|
165 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); | |
166 |
|
166 | |||
167 | public: |
|
167 | public: | |
168 | DeclarativeAxes *m_axes; |
|
168 | DeclarativeAxes *m_axes; | |
169 | }; |
|
169 | }; | |
170 |
|
170 | |||
171 | class DeclarativePercentBarSeries : public QPercentBarSeries, public QQmlParserStatus |
|
171 | class DeclarativePercentBarSeries : public QPercentBarSeries, public QQmlParserStatus | |
172 | { |
|
172 | { | |
173 | Q_OBJECT |
|
173 | Q_OBJECT | |
174 | Q_INTERFACES(QQmlParserStatus) |
|
174 | Q_INTERFACES(QQmlParserStatus) | |
175 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
175 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
176 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
176 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
177 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
177 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
178 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
178 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
179 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
179 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
180 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
180 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
181 |
|
181 | |||
182 | public: |
|
182 | public: | |
183 | explicit DeclarativePercentBarSeries(QQuickItem *parent = 0); |
|
183 | explicit DeclarativePercentBarSeries(QQuickItem *parent = 0); | |
184 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
184 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
185 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
185 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
186 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
186 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
187 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
187 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
188 |
|
|
188 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
189 |
|
|
189 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
190 |
|
|
190 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
191 |
|
|
191 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
192 | QQmlListProperty<QObject> seriesChildren(); |
|
192 | QQmlListProperty<QObject> seriesChildren(); | |
193 |
|
193 | |||
194 | public: |
|
194 | public: | |
195 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
195 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
196 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
196 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
197 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
197 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
198 | Q_INVOKABLE bool remove(QBarSet *barset) { return QPercentBarSeries::remove(barset); } |
|
198 | Q_INVOKABLE bool remove(QBarSet *barset) { return QPercentBarSeries::remove(barset); } | |
199 | Q_INVOKABLE void clear() { return QPercentBarSeries::clear(); } |
|
199 | Q_INVOKABLE void clear() { return QPercentBarSeries::clear(); } | |
200 |
|
200 | |||
201 | public: // from QDeclarativeParserStatus |
|
201 | public: // from QDeclarativeParserStatus | |
202 | void classBegin(); |
|
202 | void classBegin(); | |
203 | void componentComplete(); |
|
203 | void componentComplete(); | |
204 |
|
204 | |||
205 | Q_SIGNALS: |
|
205 | Q_SIGNALS: | |
206 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
206 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
207 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
207 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
208 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
208 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
209 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
209 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
210 |
|
210 | |||
211 | public Q_SLOTS: |
|
211 | public Q_SLOTS: | |
212 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); |
|
212 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); | |
213 |
|
213 | |||
214 | public: |
|
214 | public: | |
215 | DeclarativeAxes *m_axes; |
|
215 | DeclarativeAxes *m_axes; | |
216 | }; |
|
216 | }; | |
217 |
|
217 | |||
218 | class DeclarativeHorizontalBarSeries : public QHorizontalBarSeries, public QQmlParserStatus |
|
218 | class DeclarativeHorizontalBarSeries : public QHorizontalBarSeries, public QQmlParserStatus | |
219 | { |
|
219 | { | |
220 | Q_OBJECT |
|
220 | Q_OBJECT | |
221 | Q_INTERFACES(QQmlParserStatus) |
|
221 | Q_INTERFACES(QQmlParserStatus) | |
222 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
222 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
223 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
223 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
224 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
224 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
225 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
225 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
226 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
226 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
227 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
227 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
228 |
|
228 | |||
229 | public: |
|
229 | public: | |
230 | explicit DeclarativeHorizontalBarSeries(QQuickItem *parent = 0); |
|
230 | explicit DeclarativeHorizontalBarSeries(QQuickItem *parent = 0); | |
231 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
231 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
232 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
232 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
233 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
233 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
234 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
234 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
235 |
|
|
235 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
236 |
|
|
236 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
237 |
|
|
237 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
238 |
|
|
238 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
239 | QQmlListProperty<QObject> seriesChildren(); |
|
239 | QQmlListProperty<QObject> seriesChildren(); | |
240 |
|
240 | |||
241 | public: |
|
241 | public: | |
242 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
242 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
243 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
243 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
244 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
244 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
245 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalBarSeries::remove(barset); } |
|
245 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalBarSeries::remove(barset); } | |
246 | Q_INVOKABLE void clear() { return QHorizontalBarSeries::clear(); } |
|
246 | Q_INVOKABLE void clear() { return QHorizontalBarSeries::clear(); } | |
247 |
|
247 | |||
248 | public: // from QDeclarativeParserStatus |
|
248 | public: // from QDeclarativeParserStatus | |
249 | void classBegin(); |
|
249 | void classBegin(); | |
250 | void componentComplete(); |
|
250 | void componentComplete(); | |
251 |
|
251 | |||
252 | Q_SIGNALS: |
|
252 | Q_SIGNALS: | |
253 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
253 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
254 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
254 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
255 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
255 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
256 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
256 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
257 |
|
257 | |||
258 | public Q_SLOTS: |
|
258 | public Q_SLOTS: | |
259 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); |
|
259 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); | |
260 |
|
260 | |||
261 | public: |
|
261 | public: | |
262 | DeclarativeAxes *m_axes; |
|
262 | DeclarativeAxes *m_axes; | |
263 | }; |
|
263 | }; | |
264 |
|
264 | |||
265 | class DeclarativeHorizontalStackedBarSeries : public QHorizontalStackedBarSeries, public QQmlParserStatus |
|
265 | class DeclarativeHorizontalStackedBarSeries : public QHorizontalStackedBarSeries, public QQmlParserStatus | |
266 | { |
|
266 | { | |
267 | Q_OBJECT |
|
267 | Q_OBJECT | |
268 | Q_INTERFACES(QQmlParserStatus) |
|
268 | Q_INTERFACES(QQmlParserStatus) | |
269 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
269 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
270 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
270 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
271 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
271 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
272 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
272 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
273 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
273 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
274 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
274 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
275 |
|
275 | |||
276 | public: |
|
276 | public: | |
277 | explicit DeclarativeHorizontalStackedBarSeries(QQuickItem *parent = 0); |
|
277 | explicit DeclarativeHorizontalStackedBarSeries(QQuickItem *parent = 0); | |
278 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
278 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
279 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
279 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
280 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
280 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
281 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
281 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
282 |
|
|
282 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
283 |
|
|
283 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
284 |
|
|
284 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
285 |
|
|
285 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
286 | QQmlListProperty<QObject> seriesChildren(); |
|
286 | QQmlListProperty<QObject> seriesChildren(); | |
287 |
|
287 | |||
288 | public: |
|
288 | public: | |
289 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
289 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
290 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
290 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
291 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
291 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
292 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalStackedBarSeries::remove(barset); } |
|
292 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalStackedBarSeries::remove(barset); } | |
293 | Q_INVOKABLE void clear() { return QHorizontalStackedBarSeries::clear(); } |
|
293 | Q_INVOKABLE void clear() { return QHorizontalStackedBarSeries::clear(); } | |
294 |
|
294 | |||
295 | public: // from QDeclarativeParserStatus |
|
295 | public: // from QDeclarativeParserStatus | |
296 | void classBegin(); |
|
296 | void classBegin(); | |
297 | void componentComplete(); |
|
297 | void componentComplete(); | |
298 |
|
298 | |||
299 | Q_SIGNALS: |
|
299 | Q_SIGNALS: | |
300 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
300 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
301 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
301 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
302 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
302 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
303 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
303 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
304 |
|
304 | |||
305 | public Q_SLOTS: |
|
305 | public Q_SLOTS: | |
306 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); |
|
306 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); | |
307 |
|
307 | |||
308 | public: |
|
308 | public: | |
309 | DeclarativeAxes *m_axes; |
|
309 | DeclarativeAxes *m_axes; | |
310 | }; |
|
310 | }; | |
311 |
|
311 | |||
312 | class DeclarativeHorizontalPercentBarSeries : public QHorizontalPercentBarSeries, public QQmlParserStatus |
|
312 | class DeclarativeHorizontalPercentBarSeries : public QHorizontalPercentBarSeries, public QQmlParserStatus | |
313 | { |
|
313 | { | |
314 | Q_OBJECT |
|
314 | Q_OBJECT | |
315 | Q_INTERFACES(QQmlParserStatus) |
|
315 | Q_INTERFACES(QQmlParserStatus) | |
316 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
316 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
317 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
317 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
318 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
318 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
319 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
319 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
320 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
320 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
321 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
321 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
322 |
|
322 | |||
323 | public: |
|
323 | public: | |
324 | explicit DeclarativeHorizontalPercentBarSeries(QQuickItem *parent = 0); |
|
324 | explicit DeclarativeHorizontalPercentBarSeries(QQuickItem *parent = 0); | |
325 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
325 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
326 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
326 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
327 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
327 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
328 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
328 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
329 |
|
|
329 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
330 |
|
|
330 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
331 |
|
|
331 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
332 |
|
|
332 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
333 | QQmlListProperty<QObject> seriesChildren(); |
|
333 | QQmlListProperty<QObject> seriesChildren(); | |
334 |
|
334 | |||
335 | public: |
|
335 | public: | |
336 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
336 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
337 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
337 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
338 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
338 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
339 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalPercentBarSeries::remove(barset); } |
|
339 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalPercentBarSeries::remove(barset); } | |
340 | Q_INVOKABLE void clear() { return QHorizontalPercentBarSeries::clear(); } |
|
340 | Q_INVOKABLE void clear() { return QHorizontalPercentBarSeries::clear(); } | |
341 |
|
341 | |||
342 | public: // from QDeclarativeParserStatus |
|
342 | public: // from QDeclarativeParserStatus | |
343 | void classBegin(); |
|
343 | void classBegin(); | |
344 | void componentComplete(); |
|
344 | void componentComplete(); | |
345 |
|
345 | |||
346 | Q_SIGNALS: |
|
346 | Q_SIGNALS: | |
347 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
347 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
348 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
348 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
349 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
349 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
350 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
350 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
351 |
|
351 | |||
352 | public Q_SLOTS: |
|
352 | public Q_SLOTS: | |
353 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); |
|
353 | static void appendSeriesChildren(QQmlListProperty<QObject> *list, QObject *element); | |
354 |
|
354 | |||
355 | public: |
|
355 | public: | |
356 | DeclarativeAxes *m_axes; |
|
356 | DeclarativeAxes *m_axes; | |
357 | }; |
|
357 | }; | |
358 |
|
358 | |||
359 | QT_CHARTS_END_NAMESPACE |
|
359 | QT_CHARTS_END_NAMESPACE | |
360 |
|
360 | |||
361 | #endif // DECLARATIVEBARSERIES_H |
|
361 | #endif // DECLARATIVEBARSERIES_H |
@@ -1,231 +1,231 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2014 Digia Plc |
|
3 | ** Copyright (C) 2014 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVECHART_H |
|
21 | #ifndef DECLARATIVECHART_H | |
22 | #define DECLARATIVECHART_H |
|
22 | #define DECLARATIVECHART_H | |
23 |
|
23 | |||
24 | #include <QtCore/QtGlobal> |
|
24 | #include <QtCore/QtGlobal> | |
25 | #include <QtQuick/QQuickItem> |
|
25 | #include <QtQuick/QQuickItem> | |
26 | #include <QtQuick/QQuickPaintedItem> |
|
26 | #include <QtQuick/QQuickPaintedItem> | |
27 | #include <QtWidgets/QGraphicsScene> |
|
27 | #include <QtWidgets/QGraphicsScene> | |
28 | #include <QtCore/QMutex> |
|
28 | #include <QtCore/QMutex> | |
29 |
|
29 | |||
30 | #include <QtCharts/QChart> |
|
30 | #include <QtCharts/QChart> | |
31 | #include <QtCore/QLocale> |
|
31 | #include <QtCore/QLocale> | |
32 |
|
32 | |||
33 | QT_CHARTS_BEGIN_NAMESPACE |
|
33 | QT_CHARTS_BEGIN_NAMESPACE | |
34 |
|
34 | |||
35 | class DeclarativeMargins; |
|
35 | class DeclarativeMargins; | |
36 | class Domain; |
|
36 | class Domain; | |
37 | class DeclarativeAxes; |
|
37 | class DeclarativeAxes; | |
38 |
|
38 | |||
39 | class DeclarativeChart : public QQuickPaintedItem |
|
39 | class DeclarativeChart : public QQuickPaintedItem | |
40 | { |
|
40 | { | |
41 | Q_OBJECT |
|
41 | Q_OBJECT | |
42 | Q_PROPERTY(Theme theme READ theme WRITE setTheme) |
|
42 | Q_PROPERTY(Theme theme READ theme WRITE setTheme) | |
43 | Q_PROPERTY(Animation animationOptions READ animationOptions WRITE setAnimationOptions) |
|
43 | Q_PROPERTY(Animation animationOptions READ animationOptions WRITE setAnimationOptions) | |
44 | Q_PROPERTY(QString title READ title WRITE setTitle) |
|
44 | Q_PROPERTY(QString title READ title WRITE setTitle) | |
45 | Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont) |
|
45 | Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont) | |
46 | Q_PROPERTY(QColor titleColor READ titleColor WRITE setTitleColor NOTIFY titleColorChanged) |
|
46 | Q_PROPERTY(QColor titleColor READ titleColor WRITE setTitleColor NOTIFY titleColorChanged) | |
47 | Q_PROPERTY(QLegend *legend READ legend CONSTANT) |
|
47 | Q_PROPERTY(QLegend *legend READ legend CONSTANT) | |
48 | Q_PROPERTY(int count READ count) |
|
48 | Q_PROPERTY(int count READ count) | |
49 | Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged) |
|
49 | Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged) | |
50 | Q_PROPERTY(bool dropShadowEnabled READ dropShadowEnabled WRITE setDropShadowEnabled NOTIFY dropShadowEnabledChanged) |
|
50 | Q_PROPERTY(bool dropShadowEnabled READ dropShadowEnabled WRITE setDropShadowEnabled NOTIFY dropShadowEnabledChanged) | |
51 | Q_PROPERTY(qreal backgroundRoundness READ backgroundRoundness WRITE setBackgroundRoundness NOTIFY backgroundRoundnessChanged REVISION 3) |
|
51 | Q_PROPERTY(qreal backgroundRoundness READ backgroundRoundness WRITE setBackgroundRoundness NOTIFY backgroundRoundnessChanged REVISION 3) | |
52 | Q_PROPERTY(qreal topMargin READ topMargin) |
|
52 | Q_PROPERTY(qreal topMargin READ topMargin) | |
53 | Q_PROPERTY(qreal bottomMargin READ bottomMargin) |
|
53 | Q_PROPERTY(qreal bottomMargin READ bottomMargin) | |
54 | Q_PROPERTY(qreal leftMargin READ leftMargin) |
|
54 | Q_PROPERTY(qreal leftMargin READ leftMargin) | |
55 | Q_PROPERTY(qreal rightMargin READ rightMargin) |
|
55 | Q_PROPERTY(qreal rightMargin READ rightMargin) | |
56 | Q_PROPERTY(DeclarativeMargins *minimumMargins READ minimumMargins NOTIFY minimumMarginsChanged REVISION 1) |
|
56 | Q_PROPERTY(DeclarativeMargins *minimumMargins READ minimumMargins NOTIFY minimumMarginsChanged REVISION 1) | |
57 | Q_PROPERTY(DeclarativeMargins *margins READ margins NOTIFY marginsChanged REVISION 2) |
|
57 | Q_PROPERTY(DeclarativeMargins *margins READ margins NOTIFY marginsChanged REVISION 2) | |
58 | Q_PROPERTY(QRectF plotArea READ plotArea NOTIFY plotAreaChanged REVISION 1) |
|
58 | Q_PROPERTY(QRectF plotArea READ plotArea NOTIFY plotAreaChanged REVISION 1) | |
59 | Q_PROPERTY(QColor plotAreaColor READ plotAreaColor WRITE setPlotAreaColor NOTIFY plotAreaColorChanged REVISION 3) |
|
59 | Q_PROPERTY(QColor plotAreaColor READ plotAreaColor WRITE setPlotAreaColor NOTIFY plotAreaColorChanged REVISION 3) | |
60 | Q_PROPERTY(QQmlListProperty<QAbstractAxis> axes READ axes REVISION 2) |
|
60 | Q_PROPERTY(QQmlListProperty<QAbstractAxis> axes READ axes REVISION 2) | |
61 | Q_PROPERTY(bool localizeNumbers READ localizeNumbers WRITE setLocalizeNumbers NOTIFY localizeNumbersChanged REVISION 4) |
|
61 | Q_PROPERTY(bool localizeNumbers READ localizeNumbers WRITE setLocalizeNumbers NOTIFY localizeNumbersChanged REVISION 4) | |
62 | Q_PROPERTY(QLocale locale READ locale WRITE setLocale NOTIFY localeChanged REVISION 4) |
|
62 | Q_PROPERTY(QLocale locale READ locale WRITE setLocale NOTIFY localeChanged REVISION 4) | |
63 | Q_ENUMS(Animation) |
|
63 | Q_ENUMS(Animation) | |
64 | Q_ENUMS(Theme) |
|
64 | Q_ENUMS(Theme) | |
65 | Q_ENUMS(SeriesType) |
|
65 | Q_ENUMS(SeriesType) | |
66 |
|
66 | |||
67 | public: |
|
67 | public: | |
68 | // duplicating enums from QChart to make the QML api namings 1-to-1 with the C++ api |
|
68 | // duplicating enums from QChart to make the QML api namings 1-to-1 with the C++ api | |
69 | enum Theme { |
|
69 | enum Theme { | |
70 | ChartThemeLight = 0, |
|
70 | ChartThemeLight = 0, | |
71 | ChartThemeBlueCerulean, |
|
71 | ChartThemeBlueCerulean, | |
72 | ChartThemeDark, |
|
72 | ChartThemeDark, | |
73 | ChartThemeBrownSand, |
|
73 | ChartThemeBrownSand, | |
74 | ChartThemeBlueNcs, |
|
74 | ChartThemeBlueNcs, | |
75 | ChartThemeHighContrast, |
|
75 | ChartThemeHighContrast, | |
76 | ChartThemeBlueIcy, |
|
76 | ChartThemeBlueIcy, | |
77 | ChartThemeQt |
|
77 | ChartThemeQt | |
78 | }; |
|
78 | }; | |
79 |
|
79 | |||
80 | enum Animation { |
|
80 | enum Animation { | |
81 | NoAnimation = 0x0, |
|
81 | NoAnimation = 0x0, | |
82 | GridAxisAnimations = 0x1, |
|
82 | GridAxisAnimations = 0x1, | |
83 | SeriesAnimations = 0x2, |
|
83 | SeriesAnimations = 0x2, | |
84 | AllAnimations = 0x3 |
|
84 | AllAnimations = 0x3 | |
85 | }; |
|
85 | }; | |
86 |
|
86 | |||
87 | enum SeriesType { |
|
87 | enum SeriesType { | |
88 | SeriesTypeLine, |
|
88 | SeriesTypeLine, | |
89 | SeriesTypeArea, |
|
89 | SeriesTypeArea, | |
90 | SeriesTypeBar, |
|
90 | SeriesTypeBar, | |
91 | SeriesTypeStackedBar, |
|
91 | SeriesTypeStackedBar, | |
92 | SeriesTypePercentBar, |
|
92 | SeriesTypePercentBar, | |
93 | SeriesTypeBoxPlot, |
|
93 | SeriesTypeBoxPlot, | |
94 | SeriesTypePie, |
|
94 | SeriesTypePie, | |
95 | SeriesTypeScatter, |
|
95 | SeriesTypeScatter, | |
96 | SeriesTypeSpline, |
|
96 | SeriesTypeSpline, | |
97 | SeriesTypeHorizontalBar, |
|
97 | SeriesTypeHorizontalBar, | |
98 | SeriesTypeHorizontalStackedBar, |
|
98 | SeriesTypeHorizontalStackedBar, | |
99 | SeriesTypeHorizontalPercentBar |
|
99 | SeriesTypeHorizontalPercentBar | |
100 | }; |
|
100 | }; | |
101 |
|
101 | |||
102 | public: |
|
102 | public: | |
103 | DeclarativeChart(QQuickItem *parent = 0); |
|
103 | DeclarativeChart(QQuickItem *parent = 0); | |
104 | ~DeclarativeChart(); |
|
104 | ~DeclarativeChart(); | |
105 |
|
105 | |||
106 | public: // From parent classes |
|
106 | public: // From parent classes | |
107 | void childEvent(QChildEvent *event); |
|
107 | void childEvent(QChildEvent *event); | |
108 | void componentComplete(); |
|
108 | void componentComplete(); | |
109 | void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry); |
|
109 | void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry); | |
110 | void paint(QPainter *painter); |
|
110 | void paint(QPainter *painter); | |
111 | protected: |
|
111 | protected: | |
112 | void mousePressEvent(QMouseEvent *event); |
|
112 | void mousePressEvent(QMouseEvent *event); | |
113 | void mouseReleaseEvent(QMouseEvent *event); |
|
113 | void mouseReleaseEvent(QMouseEvent *event); | |
114 | void hoverMoveEvent(QHoverEvent *event); |
|
114 | void hoverMoveEvent(QHoverEvent *event); | |
115 | private Q_SLOTS: |
|
115 | private Q_SLOTS: | |
116 | void handleAntialiasingChanged(bool enable); |
|
116 | void handleAntialiasingChanged(bool enable); | |
117 | void sceneChanged(QList<QRectF> region); |
|
117 | void sceneChanged(QList<QRectF> region); | |
118 | void renderScene(); |
|
118 | void renderScene(); | |
119 |
|
119 | |||
120 | public: |
|
120 | public: | |
121 | void setTheme(DeclarativeChart::Theme theme); |
|
121 | void setTheme(DeclarativeChart::Theme theme); | |
122 | DeclarativeChart::Theme theme(); |
|
122 | DeclarativeChart::Theme theme(); | |
123 | void setAnimationOptions(DeclarativeChart::Animation animations); |
|
123 | void setAnimationOptions(DeclarativeChart::Animation animations); | |
124 | DeclarativeChart::Animation animationOptions(); |
|
124 | DeclarativeChart::Animation animationOptions(); | |
125 | void setTitle(QString title); |
|
125 | void setTitle(QString title); | |
126 | QString title(); |
|
126 | QString title(); | |
127 | QLegend *legend(); |
|
127 | QLegend *legend(); | |
128 | QFont titleFont() const; |
|
128 | QFont titleFont() const; | |
129 | void setTitleFont(const QFont &font); |
|
129 | void setTitleFont(const QFont &font); | |
130 | void setTitleColor(QColor color); |
|
130 | void setTitleColor(QColor color); | |
131 | QColor titleColor(); |
|
131 | QColor titleColor(); | |
132 | void setBackgroundColor(QColor color); |
|
132 | void setBackgroundColor(QColor color); | |
133 | QColor backgroundColor(); |
|
133 | QColor backgroundColor(); | |
134 |
|
|
134 | void setPlotAreaColor(QColor color); | |
135 |
|
|
135 | QColor plotAreaColor(); | |
136 |
|
|
136 | void setLocalizeNumbers(bool localize); | |
137 |
|
|
137 | bool localizeNumbers() const; | |
138 |
|
|
138 | void setLocale(const QLocale &locale); | |
139 |
|
|
139 | QLocale locale() const; | |
140 |
|
140 | |||
141 | int count(); |
|
141 | int count(); | |
142 | void setDropShadowEnabled(bool enabled); |
|
142 | void setDropShadowEnabled(bool enabled); | |
143 | bool dropShadowEnabled(); |
|
143 | bool dropShadowEnabled(); | |
144 |
|
|
144 | qreal backgroundRoundness() const; | |
145 |
|
|
145 | void setBackgroundRoundness(qreal diameter); | |
146 |
|
146 | |||
147 | // Margins & plotArea |
|
147 | // Margins & plotArea | |
148 | qreal topMargin(); |
|
148 | qreal topMargin(); | |
149 | qreal bottomMargin(); |
|
149 | qreal bottomMargin(); | |
150 | qreal leftMargin(); |
|
150 | qreal leftMargin(); | |
151 | qreal rightMargin(); |
|
151 | qreal rightMargin(); | |
152 | DeclarativeMargins *minimumMargins() { return m_margins; } |
|
152 | DeclarativeMargins *minimumMargins() { return m_margins; } | |
153 |
|
|
153 | DeclarativeMargins *margins() { return m_margins; } | |
154 | QRectF plotArea() { return m_chart->plotArea(); } |
|
154 | QRectF plotArea() { return m_chart->plotArea(); } | |
155 |
|
155 | |||
156 | // Axis handling |
|
156 | // Axis handling | |
157 | QAbstractAxis *defaultAxis(Qt::Orientation orientation, QAbstractSeries *series); |
|
157 | QAbstractAxis *defaultAxis(Qt::Orientation orientation, QAbstractSeries *series); | |
158 | void initializeAxes(QAbstractSeries *series); |
|
158 | void initializeAxes(QAbstractSeries *series); | |
159 | void doInitializeAxes(QAbstractSeries *series, DeclarativeAxes *axes); |
|
159 | void doInitializeAxes(QAbstractSeries *series, DeclarativeAxes *axes); | |
160 | QQmlListProperty<QAbstractAxis> axes(); |
|
160 | QQmlListProperty<QAbstractAxis> axes(); | |
161 | static void axesAppendFunc(QQmlListProperty<QAbstractAxis> *list, QAbstractAxis *element); |
|
161 | static void axesAppendFunc(QQmlListProperty<QAbstractAxis> *list, QAbstractAxis *element); | |
162 | static int axesCountFunc(QQmlListProperty<QAbstractAxis> *list); |
|
162 | static int axesCountFunc(QQmlListProperty<QAbstractAxis> *list); | |
163 | static QAbstractAxis *axesAtFunc(QQmlListProperty<QAbstractAxis> *list, int index); |
|
163 | static QAbstractAxis *axesAtFunc(QQmlListProperty<QAbstractAxis> *list, int index); | |
164 | static void axesClearFunc(QQmlListProperty<QAbstractAxis> *list); |
|
164 | static void axesClearFunc(QQmlListProperty<QAbstractAxis> *list); | |
165 |
|
165 | |||
166 | public: |
|
166 | public: | |
167 | Q_INVOKABLE QAbstractSeries *series(int index); |
|
167 | Q_INVOKABLE QAbstractSeries *series(int index); | |
168 | Q_INVOKABLE QAbstractSeries *series(QString seriesName); |
|
168 | Q_INVOKABLE QAbstractSeries *series(QString seriesName); | |
169 | Q_INVOKABLE QAbstractSeries *createSeries(int type, QString name = "", QAbstractAxis *axisX = 0, QAbstractAxis *axisY = 0); |
|
169 | Q_INVOKABLE QAbstractSeries *createSeries(int type, QString name = "", QAbstractAxis *axisX = 0, QAbstractAxis *axisY = 0); | |
170 | Q_INVOKABLE void removeSeries(QAbstractSeries *series); |
|
170 | Q_INVOKABLE void removeSeries(QAbstractSeries *series); | |
171 | Q_INVOKABLE void removeAllSeries() { m_chart->removeAllSeries(); } |
|
171 | Q_INVOKABLE void removeAllSeries() { m_chart->removeAllSeries(); } | |
172 | Q_INVOKABLE void setAxisX(QAbstractAxis *axis, QAbstractSeries *series = 0); |
|
172 | Q_INVOKABLE void setAxisX(QAbstractAxis *axis, QAbstractSeries *series = 0); | |
173 | Q_INVOKABLE void setAxisY(QAbstractAxis *axis, QAbstractSeries *series = 0); |
|
173 | Q_INVOKABLE void setAxisY(QAbstractAxis *axis, QAbstractSeries *series = 0); | |
174 | Q_INVOKABLE void createDefaultAxes(); |
|
174 | Q_INVOKABLE void createDefaultAxes(); | |
175 | Q_INVOKABLE QAbstractAxis *axisX(QAbstractSeries *series = 0); |
|
175 | Q_INVOKABLE QAbstractAxis *axisX(QAbstractSeries *series = 0); | |
176 | Q_INVOKABLE QAbstractAxis *axisY(QAbstractSeries *series = 0); |
|
176 | Q_INVOKABLE QAbstractAxis *axisY(QAbstractSeries *series = 0); | |
177 | Q_INVOKABLE void zoom(qreal factor); |
|
177 | Q_INVOKABLE void zoom(qreal factor); | |
178 | Q_INVOKABLE void scrollLeft(qreal pixels); |
|
178 | Q_INVOKABLE void scrollLeft(qreal pixels); | |
179 | Q_INVOKABLE void scrollRight(qreal pixels); |
|
179 | Q_INVOKABLE void scrollRight(qreal pixels); | |
180 | Q_INVOKABLE void scrollUp(qreal pixels); |
|
180 | Q_INVOKABLE void scrollUp(qreal pixels); | |
181 | Q_INVOKABLE void scrollDown(qreal pixels); |
|
181 | Q_INVOKABLE void scrollDown(qreal pixels); | |
182 |
|
182 | |||
183 | Q_SIGNALS: |
|
183 | Q_SIGNALS: | |
184 | void axisLabelsChanged(); |
|
184 | void axisLabelsChanged(); | |
185 | void titleColorChanged(QColor color); |
|
185 | void titleColorChanged(QColor color); | |
186 | void backgroundColorChanged(); |
|
186 | void backgroundColorChanged(); | |
187 | void dropShadowEnabledChanged(bool enabled); |
|
187 | void dropShadowEnabledChanged(bool enabled); | |
188 | void minimumMarginsChanged(); |
|
188 | void minimumMarginsChanged(); | |
189 | Q_REVISION(2) void marginsChanged(); |
|
189 | Q_REVISION(2) void marginsChanged(); | |
190 | void plotAreaChanged(QRectF plotArea); |
|
190 | void plotAreaChanged(QRectF plotArea); | |
191 | void seriesAdded(QAbstractSeries *series); |
|
191 | void seriesAdded(QAbstractSeries *series); | |
192 | void seriesRemoved(QAbstractSeries *series); |
|
192 | void seriesRemoved(QAbstractSeries *series); | |
193 | Q_REVISION(3) void plotAreaColorChanged(); |
|
193 | Q_REVISION(3) void plotAreaColorChanged(); | |
194 | Q_REVISION(3) void backgroundRoundnessChanged(qreal diameter); |
|
194 | Q_REVISION(3) void backgroundRoundnessChanged(qreal diameter); | |
195 | Q_REVISION(4) void localizeNumbersChanged(); |
|
195 | Q_REVISION(4) void localizeNumbersChanged(); | |
196 | Q_REVISION(4) void localeChanged(); |
|
196 | Q_REVISION(4) void localeChanged(); | |
197 |
|
197 | |||
198 | private Q_SLOTS: |
|
198 | private Q_SLOTS: | |
199 | void changeMinimumMargins(int top, int bottom, int left, int right); |
|
199 | void changeMinimumMargins(int top, int bottom, int left, int right); | |
200 | void handleAxisXSet(QAbstractAxis *axis); |
|
200 | void handleAxisXSet(QAbstractAxis *axis); | |
201 | void handleAxisYSet(QAbstractAxis *axis); |
|
201 | void handleAxisYSet(QAbstractAxis *axis); | |
202 | void handleAxisXTopSet(QAbstractAxis *axis); |
|
202 | void handleAxisXTopSet(QAbstractAxis *axis); | |
203 | void handleAxisYRightSet(QAbstractAxis *axis); |
|
203 | void handleAxisYRightSet(QAbstractAxis *axis); | |
204 | void handleSeriesAdded(QAbstractSeries *series); |
|
204 | void handleSeriesAdded(QAbstractSeries *series); | |
205 |
|
205 | |||
206 | protected: |
|
206 | protected: | |
207 | explicit DeclarativeChart(QChart::ChartType type, QQuickItem *parent); |
|
207 | explicit DeclarativeChart(QChart::ChartType type, QQuickItem *parent); | |
208 |
|
208 | |||
209 | private: |
|
209 | private: | |
210 | void initChart(QChart::ChartType type); |
|
210 | void initChart(QChart::ChartType type); | |
211 | // Extending QChart with DeclarativeChart is not possible because QObject does not support |
|
211 | // Extending QChart with DeclarativeChart is not possible because QObject does not support | |
212 | // multi inheritance, so we now have a QChart as a member instead |
|
212 | // multi inheritance, so we now have a QChart as a member instead | |
213 | QChart *m_chart; |
|
213 | QChart *m_chart; | |
214 | QGraphicsScene *m_scene; |
|
214 | QGraphicsScene *m_scene; | |
215 | QPointF m_mousePressScenePoint; |
|
215 | QPointF m_mousePressScenePoint; | |
216 | QPoint m_mousePressScreenPoint; |
|
216 | QPoint m_mousePressScreenPoint; | |
217 | QPointF m_lastMouseMoveScenePoint; |
|
217 | QPointF m_lastMouseMoveScenePoint; | |
218 | QPoint m_lastMouseMoveScreenPoint; |
|
218 | QPoint m_lastMouseMoveScreenPoint; | |
219 | Qt::MouseButton m_mousePressButton; |
|
219 | Qt::MouseButton m_mousePressButton; | |
220 | Qt::MouseButtons m_mousePressButtons; |
|
220 | Qt::MouseButtons m_mousePressButtons; | |
221 | QMutex m_sceneImageLock; |
|
221 | QMutex m_sceneImageLock; | |
222 | QImage *m_currentSceneImage; |
|
222 | QImage *m_currentSceneImage; | |
223 | bool m_updatePending; |
|
223 | bool m_updatePending; | |
224 | Qt::HANDLE m_paintThreadId; |
|
224 | Qt::HANDLE m_paintThreadId; | |
225 | Qt::HANDLE m_guiThreadId; |
|
225 | Qt::HANDLE m_guiThreadId; | |
226 | DeclarativeMargins *m_margins; |
|
226 | DeclarativeMargins *m_margins; | |
227 | }; |
|
227 | }; | |
228 |
|
228 | |||
229 | QT_CHARTS_END_NAMESPACE |
|
229 | QT_CHARTS_END_NAMESPACE | |
230 |
|
230 | |||
231 | #endif // DECLARATIVECHART_H |
|
231 | #endif // DECLARATIVECHART_H |
@@ -1,109 +1,109 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2014 Digia Plc |
|
3 | ** Copyright (C) 2014 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVELINESERIES_H |
|
21 | #ifndef DECLARATIVELINESERIES_H | |
22 | #define DECLARATIVELINESERIES_H |
|
22 | #define DECLARATIVELINESERIES_H | |
23 |
|
23 | |||
24 | #include <QtCharts/QLineSeries> |
|
24 | #include <QtCharts/QLineSeries> | |
25 | #include "declarativexyseries.h" |
|
25 | #include "declarativexyseries.h" | |
26 | #include "declarativeaxes.h" |
|
26 | #include "declarativeaxes.h" | |
27 |
|
27 | |||
28 | #include <QtQml/QQmlListProperty> |
|
28 | #include <QtQml/QQmlListProperty> | |
29 | #include <QtQml/QQmlParserStatus> |
|
29 | #include <QtQml/QQmlParserStatus> | |
30 |
|
30 | |||
31 | QT_CHARTS_BEGIN_NAMESPACE |
|
31 | QT_CHARTS_BEGIN_NAMESPACE | |
32 |
|
32 | |||
33 | class DeclarativeLineSeries : public QLineSeries, public DeclarativeXySeries, public QQmlParserStatus |
|
33 | class DeclarativeLineSeries : public QLineSeries, public DeclarativeXySeries, public QQmlParserStatus | |
34 | { |
|
34 | { | |
35 | Q_OBJECT |
|
35 | Q_OBJECT | |
36 | Q_INTERFACES(QQmlParserStatus) |
|
36 | Q_INTERFACES(QQmlParserStatus) | |
37 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
37 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
38 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
38 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
39 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
39 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
40 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
40 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
41 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
41 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
42 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) |
|
42 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) | |
43 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) |
|
43 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) | |
44 | Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged REVISION 1) |
|
44 | Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged REVISION 1) | |
45 | Q_PROPERTY(Qt::PenStyle style READ style WRITE setStyle NOTIFY styleChanged REVISION 1) |
|
45 | Q_PROPERTY(Qt::PenStyle style READ style WRITE setStyle NOTIFY styleChanged REVISION 1) | |
46 | Q_PROPERTY(Qt::PenCapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY capStyleChanged REVISION 1) |
|
46 | Q_PROPERTY(Qt::PenCapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY capStyleChanged REVISION 1) | |
47 | Q_PROPERTY(QQmlListProperty<QObject> declarativeChildren READ declarativeChildren) |
|
47 | Q_PROPERTY(QQmlListProperty<QObject> declarativeChildren READ declarativeChildren) | |
48 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") |
|
48 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") | |
49 |
|
49 | |||
50 | public: |
|
50 | public: | |
51 | explicit DeclarativeLineSeries(QObject *parent = 0); |
|
51 | explicit DeclarativeLineSeries(QObject *parent = 0); | |
52 | QXYSeries *xySeries() { return this; } |
|
52 | QXYSeries *xySeries() { return this; } | |
53 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
53 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
54 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
54 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
55 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
55 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
56 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
56 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
57 |
|
|
57 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
58 |
|
|
58 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
59 |
|
|
59 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
60 |
|
|
60 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
61 |
|
|
61 | QAbstractAxis *axisAngular() { return m_axes->axisX(); } | |
62 |
|
|
62 | void setAxisAngular(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
63 |
|
|
63 | QAbstractAxis *axisRadial() { return m_axes->axisY(); } | |
64 |
|
|
64 | void setAxisRadial(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
65 | qreal width() const; |
|
65 | qreal width() const; | |
66 | void setWidth(qreal width); |
|
66 | void setWidth(qreal width); | |
67 | Qt::PenStyle style() const; |
|
67 | Qt::PenStyle style() const; | |
68 | void setStyle(Qt::PenStyle style); |
|
68 | void setStyle(Qt::PenStyle style); | |
69 | Qt::PenCapStyle capStyle() const; |
|
69 | Qt::PenCapStyle capStyle() const; | |
70 | void setCapStyle(Qt::PenCapStyle capStyle); |
|
70 | void setCapStyle(Qt::PenCapStyle capStyle); | |
71 | QQmlListProperty<QObject> declarativeChildren(); |
|
71 | QQmlListProperty<QObject> declarativeChildren(); | |
72 |
|
72 | |||
73 | public: // from QDeclarativeParserStatus |
|
73 | public: // from QDeclarativeParserStatus | |
74 | void classBegin() { DeclarativeXySeries::classBegin(); } |
|
74 | void classBegin() { DeclarativeXySeries::classBegin(); } | |
75 | void componentComplete() { DeclarativeXySeries::componentComplete(); } |
|
75 | void componentComplete() { DeclarativeXySeries::componentComplete(); } | |
76 |
|
76 | |||
77 | public: |
|
77 | public: | |
78 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } |
|
78 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } | |
79 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } |
|
79 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } | |
80 | Q_REVISION(3) Q_INVOKABLE void replace(int index, qreal newX, qreal newY) { DeclarativeXySeries::replace(index, newX, newY); } |
|
80 | Q_REVISION(3) Q_INVOKABLE void replace(int index, qreal newX, qreal newY) { DeclarativeXySeries::replace(index, newX, newY); } | |
81 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } |
|
81 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } | |
82 | Q_REVISION(3) Q_INVOKABLE void remove(int index) { DeclarativeXySeries::remove(index); } |
|
82 | Q_REVISION(3) Q_INVOKABLE void remove(int index) { DeclarativeXySeries::remove(index); } | |
83 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } |
|
83 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } | |
84 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } |
|
84 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } | |
85 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } |
|
85 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } | |
86 |
|
86 | |||
87 | Q_SIGNALS: |
|
87 | Q_SIGNALS: | |
88 | void countChanged(int count); |
|
88 | void countChanged(int count); | |
89 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
89 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
90 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
90 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
91 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
91 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
92 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
92 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
93 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); |
|
93 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); | |
94 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); |
|
94 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); | |
95 | Q_REVISION(1) void widthChanged(qreal width); |
|
95 | Q_REVISION(1) void widthChanged(qreal width); | |
96 | Q_REVISION(1) void styleChanged(Qt::PenStyle style); |
|
96 | Q_REVISION(1) void styleChanged(Qt::PenStyle style); | |
97 | Q_REVISION(1) void capStyleChanged(Qt::PenCapStyle capStyle); |
|
97 | Q_REVISION(1) void capStyleChanged(Qt::PenCapStyle capStyle); | |
98 |
|
98 | |||
99 | public Q_SLOTS: |
|
99 | public Q_SLOTS: | |
100 | static void appendDeclarativeChildren(QQmlListProperty<QObject> *list, QObject *element); |
|
100 | static void appendDeclarativeChildren(QQmlListProperty<QObject> *list, QObject *element); | |
101 | void handleCountChanged(int index); |
|
101 | void handleCountChanged(int index); | |
102 |
|
102 | |||
103 | public: |
|
103 | public: | |
104 | DeclarativeAxes *m_axes; |
|
104 | DeclarativeAxes *m_axes; | |
105 | }; |
|
105 | }; | |
106 |
|
106 | |||
107 | QT_CHARTS_END_NAMESPACE |
|
107 | QT_CHARTS_END_NAMESPACE | |
108 |
|
108 | |||
109 | #endif // DECLARATIVELINESERIES_H |
|
109 | #endif // DECLARATIVELINESERIES_H |
@@ -1,116 +1,116 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2014 Digia Plc |
|
3 | ** Copyright (C) 2014 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVESCATTERSERIES_H |
|
21 | #ifndef DECLARATIVESCATTERSERIES_H | |
22 | #define DECLARATIVESCATTERSERIES_H |
|
22 | #define DECLARATIVESCATTERSERIES_H | |
23 |
|
23 | |||
24 | #include <QtCharts/QScatterSeries> |
|
24 | #include <QtCharts/QScatterSeries> | |
25 | #include "declarativexyseries.h" |
|
25 | #include "declarativexyseries.h" | |
26 | #include "declarativeaxes.h" |
|
26 | #include "declarativeaxes.h" | |
27 |
|
27 | |||
28 | #include <QtQml/QQmlListProperty> |
|
28 | #include <QtQml/QQmlListProperty> | |
29 | #include <QtQml/QQmlParserStatus> |
|
29 | #include <QtQml/QQmlParserStatus> | |
30 |
|
30 | |||
31 | QT_CHARTS_BEGIN_NAMESPACE |
|
31 | QT_CHARTS_BEGIN_NAMESPACE | |
32 |
|
32 | |||
33 | class DeclarativeScatterSeries : public QScatterSeries, public DeclarativeXySeries, public QQmlParserStatus |
|
33 | class DeclarativeScatterSeries : public QScatterSeries, public DeclarativeXySeries, public QQmlParserStatus | |
34 | { |
|
34 | { | |
35 | Q_OBJECT |
|
35 | Q_OBJECT | |
36 | Q_INTERFACES(QQmlParserStatus) |
|
36 | Q_INTERFACES(QQmlParserStatus) | |
37 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
37 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
38 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
38 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
39 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
39 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
40 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
40 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
41 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
41 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
42 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) |
|
42 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) | |
43 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) |
|
43 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) | |
44 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) |
|
44 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) | |
45 | Q_PROPERTY(QQmlListProperty<QObject> declarativeChildren READ declarativeChildren) |
|
45 | Q_PROPERTY(QQmlListProperty<QObject> declarativeChildren READ declarativeChildren) | |
46 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION 4) |
|
46 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION 4) | |
47 | Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged REVISION 4) |
|
47 | Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged REVISION 4) | |
48 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") |
|
48 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") | |
49 |
|
49 | |||
50 | public: |
|
50 | public: | |
51 | explicit DeclarativeScatterSeries(QObject *parent = 0); |
|
51 | explicit DeclarativeScatterSeries(QObject *parent = 0); | |
52 | QXYSeries *xySeries() { return this; } |
|
52 | QXYSeries *xySeries() { return this; } | |
53 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
53 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
54 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
54 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
55 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
55 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
56 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
56 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
57 |
|
|
57 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
58 |
|
|
58 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
59 |
|
|
59 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
60 |
|
|
60 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
61 |
|
|
61 | QAbstractAxis *axisAngular() { return m_axes->axisX(); } | |
62 |
|
|
62 | void setAxisAngular(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
63 |
|
|
63 | QAbstractAxis *axisRadial() { return m_axes->axisY(); } | |
64 |
|
|
64 | void setAxisRadial(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
65 | qreal borderWidth() const; |
|
65 | qreal borderWidth() const; | |
66 | void setBorderWidth(qreal borderWidth); |
|
66 | void setBorderWidth(qreal borderWidth); | |
67 | QQmlListProperty<QObject> declarativeChildren(); |
|
67 | QQmlListProperty<QObject> declarativeChildren(); | |
68 | QString brushFilename() const; |
|
68 | QString brushFilename() const; | |
69 | void setBrushFilename(const QString &brushFilename); |
|
69 | void setBrushFilename(const QString &brushFilename); | |
70 | void setBrush(const QBrush &brush); |
|
70 | void setBrush(const QBrush &brush); | |
71 | QBrush brush() const; |
|
71 | QBrush brush() const; | |
72 |
|
72 | |||
73 | public: // from QDeclarativeParserStatus |
|
73 | public: // from QDeclarativeParserStatus | |
74 | void classBegin() { DeclarativeXySeries::classBegin(); } |
|
74 | void classBegin() { DeclarativeXySeries::classBegin(); } | |
75 | void componentComplete() { DeclarativeXySeries::componentComplete(); } |
|
75 | void componentComplete() { DeclarativeXySeries::componentComplete(); } | |
76 |
|
76 | |||
77 | public: |
|
77 | public: | |
78 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } |
|
78 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } | |
79 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } |
|
79 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } | |
80 | Q_REVISION(3) Q_INVOKABLE void replace(int index, qreal newX, qreal newY) { DeclarativeXySeries::replace(index, newX, newY); } |
|
80 | Q_REVISION(3) Q_INVOKABLE void replace(int index, qreal newX, qreal newY) { DeclarativeXySeries::replace(index, newX, newY); } | |
81 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } |
|
81 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } | |
82 | Q_REVISION(3) Q_INVOKABLE void remove(int index) { DeclarativeXySeries::remove(index); } |
|
82 | Q_REVISION(3) Q_INVOKABLE void remove(int index) { DeclarativeXySeries::remove(index); } | |
83 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } |
|
83 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } | |
84 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } |
|
84 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } | |
85 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } |
|
85 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } | |
86 |
|
86 | |||
87 | Q_SIGNALS: |
|
87 | Q_SIGNALS: | |
88 | void countChanged(int count); |
|
88 | void countChanged(int count); | |
89 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
89 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
90 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
90 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
91 | Q_REVISION(1) void borderWidthChanged(qreal width); |
|
91 | Q_REVISION(1) void borderWidthChanged(qreal width); | |
92 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
92 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
93 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
93 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
94 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); |
|
94 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); | |
95 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); |
|
95 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); | |
96 | Q_REVISION(4) void brushFilenameChanged(const QString &brushFilename); |
|
96 | Q_REVISION(4) void brushFilenameChanged(const QString &brushFilename); | |
97 | Q_REVISION(4) void brushChanged(); |
|
97 | Q_REVISION(4) void brushChanged(); | |
98 |
|
98 | |||
99 | public Q_SLOTS: |
|
99 | public Q_SLOTS: | |
100 | static void appendDeclarativeChildren(QQmlListProperty<QObject> *list, QObject *element); |
|
100 | static void appendDeclarativeChildren(QQmlListProperty<QObject> *list, QObject *element); | |
101 | void handleCountChanged(int index); |
|
101 | void handleCountChanged(int index); | |
102 |
|
102 | |||
103 | private Q_SLOTS: |
|
103 | private Q_SLOTS: | |
104 | void handleBrushChanged(); |
|
104 | void handleBrushChanged(); | |
105 |
|
105 | |||
106 | public: |
|
106 | public: | |
107 | DeclarativeAxes *m_axes; |
|
107 | DeclarativeAxes *m_axes; | |
108 |
|
108 | |||
109 | private: |
|
109 | private: | |
110 | QString m_brushFilename; |
|
110 | QString m_brushFilename; | |
111 | QImage m_brushImage; |
|
111 | QImage m_brushImage; | |
112 | }; |
|
112 | }; | |
113 |
|
113 | |||
114 | QT_CHARTS_END_NAMESPACE |
|
114 | QT_CHARTS_END_NAMESPACE | |
115 |
|
115 | |||
116 | #endif // DECLARATIVESCATTERSERIES_H |
|
116 | #endif // DECLARATIVESCATTERSERIES_H |
@@ -1,109 +1,109 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2014 Digia Plc |
|
3 | ** Copyright (C) 2014 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVESPLINESERIES_H |
|
21 | #ifndef DECLARATIVESPLINESERIES_H | |
22 | #define DECLARATIVESPLINESERIES_H |
|
22 | #define DECLARATIVESPLINESERIES_H | |
23 |
|
23 | |||
24 | #include <QtCharts/QSplineSeries> |
|
24 | #include <QtCharts/QSplineSeries> | |
25 | #include "declarativexyseries.h" |
|
25 | #include "declarativexyseries.h" | |
26 | #include "declarativeaxes.h" |
|
26 | #include "declarativeaxes.h" | |
27 |
|
27 | |||
28 | #include <QtQml/QQmlListProperty> |
|
28 | #include <QtQml/QQmlListProperty> | |
29 | #include <QtQml/QQmlParserStatus> |
|
29 | #include <QtQml/QQmlParserStatus> | |
30 |
|
30 | |||
31 | QT_CHARTS_BEGIN_NAMESPACE |
|
31 | QT_CHARTS_BEGIN_NAMESPACE | |
32 |
|
32 | |||
33 | class DeclarativeSplineSeries : public QSplineSeries, public DeclarativeXySeries, public QQmlParserStatus |
|
33 | class DeclarativeSplineSeries : public QSplineSeries, public DeclarativeXySeries, public QQmlParserStatus | |
34 | { |
|
34 | { | |
35 | Q_OBJECT |
|
35 | Q_OBJECT | |
36 | Q_INTERFACES(QQmlParserStatus) |
|
36 | Q_INTERFACES(QQmlParserStatus) | |
37 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
37 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
38 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
38 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
39 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
39 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
40 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
40 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
41 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
41 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
42 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) |
|
42 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) | |
43 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) |
|
43 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) | |
44 | Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged REVISION 1) |
|
44 | Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged REVISION 1) | |
45 | Q_PROPERTY(Qt::PenStyle style READ style WRITE setStyle NOTIFY styleChanged REVISION 1) |
|
45 | Q_PROPERTY(Qt::PenStyle style READ style WRITE setStyle NOTIFY styleChanged REVISION 1) | |
46 | Q_PROPERTY(Qt::PenCapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY capStyleChanged REVISION 1) |
|
46 | Q_PROPERTY(Qt::PenCapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY capStyleChanged REVISION 1) | |
47 | Q_PROPERTY(QQmlListProperty<QObject> declarativeChildren READ declarativeChildren) |
|
47 | Q_PROPERTY(QQmlListProperty<QObject> declarativeChildren READ declarativeChildren) | |
48 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") |
|
48 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") | |
49 |
|
49 | |||
50 | public: |
|
50 | public: | |
51 | explicit DeclarativeSplineSeries(QObject *parent = 0); |
|
51 | explicit DeclarativeSplineSeries(QObject *parent = 0); | |
52 | QXYSeries *xySeries() { return this; } |
|
52 | QXYSeries *xySeries() { return this; } | |
53 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
53 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
54 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
54 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
55 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
55 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
56 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
56 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
57 |
|
|
57 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
58 |
|
|
58 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
59 |
|
|
59 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
60 |
|
|
60 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
61 |
|
|
61 | QAbstractAxis *axisAngular() { return m_axes->axisX(); } | |
62 |
|
|
62 | void setAxisAngular(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
63 |
|
|
63 | QAbstractAxis *axisRadial() { return m_axes->axisY(); } | |
64 |
|
|
64 | void setAxisRadial(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
65 | qreal width() const; |
|
65 | qreal width() const; | |
66 | void setWidth(qreal width); |
|
66 | void setWidth(qreal width); | |
67 | Qt::PenStyle style() const; |
|
67 | Qt::PenStyle style() const; | |
68 | void setStyle(Qt::PenStyle style); |
|
68 | void setStyle(Qt::PenStyle style); | |
69 | Qt::PenCapStyle capStyle() const; |
|
69 | Qt::PenCapStyle capStyle() const; | |
70 | void setCapStyle(Qt::PenCapStyle capStyle); |
|
70 | void setCapStyle(Qt::PenCapStyle capStyle); | |
71 | QQmlListProperty<QObject> declarativeChildren(); |
|
71 | QQmlListProperty<QObject> declarativeChildren(); | |
72 |
|
72 | |||
73 | public: // from QDeclarativeParserStatus |
|
73 | public: // from QDeclarativeParserStatus | |
74 | void classBegin() { DeclarativeXySeries::classBegin(); } |
|
74 | void classBegin() { DeclarativeXySeries::classBegin(); } | |
75 | void componentComplete() { DeclarativeXySeries::componentComplete(); } |
|
75 | void componentComplete() { DeclarativeXySeries::componentComplete(); } | |
76 |
|
76 | |||
77 | public: |
|
77 | public: | |
78 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } |
|
78 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } | |
79 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } |
|
79 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } | |
80 | Q_REVISION(3) Q_INVOKABLE void replace(int index, qreal newX, qreal newY) { DeclarativeXySeries::replace(index, newX, newY); } |
|
80 | Q_REVISION(3) Q_INVOKABLE void replace(int index, qreal newX, qreal newY) { DeclarativeXySeries::replace(index, newX, newY); } | |
81 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } |
|
81 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } | |
82 | Q_REVISION(3) Q_INVOKABLE void remove(int index) { DeclarativeXySeries::remove(index); } |
|
82 | Q_REVISION(3) Q_INVOKABLE void remove(int index) { DeclarativeXySeries::remove(index); } | |
83 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } |
|
83 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } | |
84 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } |
|
84 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } | |
85 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } |
|
85 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } | |
86 |
|
86 | |||
87 | Q_SIGNALS: |
|
87 | Q_SIGNALS: | |
88 | void countChanged(int count); |
|
88 | void countChanged(int count); | |
89 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
89 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
90 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
90 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
91 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
91 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
92 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
92 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
93 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); |
|
93 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); | |
94 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); |
|
94 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); | |
95 | Q_REVISION(1) void widthChanged(qreal width); |
|
95 | Q_REVISION(1) void widthChanged(qreal width); | |
96 | Q_REVISION(1) void styleChanged(Qt::PenStyle style); |
|
96 | Q_REVISION(1) void styleChanged(Qt::PenStyle style); | |
97 | Q_REVISION(1) void capStyleChanged(Qt::PenCapStyle capStyle); |
|
97 | Q_REVISION(1) void capStyleChanged(Qt::PenCapStyle capStyle); | |
98 |
|
98 | |||
99 | public Q_SLOTS: |
|
99 | public Q_SLOTS: | |
100 | static void appendDeclarativeChildren(QQmlListProperty<QObject> *list, QObject *element); |
|
100 | static void appendDeclarativeChildren(QQmlListProperty<QObject> *list, QObject *element); | |
101 | void handleCountChanged(int index); |
|
101 | void handleCountChanged(int index); | |
102 |
|
102 | |||
103 | public: |
|
103 | public: | |
104 | DeclarativeAxes *m_axes; |
|
104 | DeclarativeAxes *m_axes; | |
105 | }; |
|
105 | }; | |
106 |
|
106 | |||
107 | QT_CHARTS_END_NAMESPACE |
|
107 | QT_CHARTS_END_NAMESPACE | |
108 |
|
108 | |||
109 | #endif // DECLARATIVESPLINESERIES_H |
|
109 | #endif // DECLARATIVESPLINESERIES_H |
General Comments 0
You need to be logged in to leave comments.
Login now