##// END OF EJS Templates
Add horizontal box plot model mapper....
Volker Krause -
r2873:4cbd063d2219
parent child
Show More
@@ -0,0 +1,266
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
5 ** Contact: https://www.qt.io/licensing/
6 **
7 ** This file is part of the Qt Charts module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:GPL$
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see https://www.qt.io/terms-conditions. For further
16 ** information use the contact form at https://www.qt.io/contact-us.
17 **
18 ** GNU General Public License Usage
19 ** Alternatively, this file may be used under the terms of the GNU
20 ** General Public License version 3 or (at your option) any later version
21 ** approved by the KDE Free Qt Foundation. The licenses are as published by
22 ** the Free Software Foundation and appearing in the file LICENSE.GPL3
23 ** included in the packaging of this file. Please review the following
24 ** information to ensure the GNU General Public License requirements will
25 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
26 **
27 ** $QT_END_LICENSE$
28 **
29 ****************************************************************************/
30
31 #include <QtCharts/QHBoxPlotModelMapper>
32
33 QT_CHARTS_BEGIN_NAMESPACE
34
35 /*!
36 \class QHBoxPlotModelMapper
37 \inmodule Qt Charts
38 \brief Horizontal model mapper for box plot series.
39
40 Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series.
41 Horizontal model mapper is used to create a connection between QBoxPlotSeries and QAbstractItemModel derived model object.
42 Model mapper maintains equal size of all the QBoxSets.
43 \note used model has to support adding/removing rows/columns and modifying the data of the cells.
44 */
45 /*!
46 \qmltype HBoxPlotModelMapper
47 \instantiates QHBoxPlotModelMapper
48 \inqmlmodule QtCharts
49
50 \brief Horizontal model mapper for box plot series.
51
52 HBoxPlotModelMapper allows you to use your own QAbstractItemModel derived model with data in
53 rows as a data source for any box-and-whiskers series. It is possible to use both
54 QAbstractItemModel and box-and-whiskers series data API to manipulate data. HBoxPlotModelMapper
55 keeps the series and the model in sync.
56
57 The following QML example would create a box-and-whiskers series with three box sets (assuming
58 the model has at least four rows). Each box set would contain data starting from column 1. The
59 name of a set would be defined by the vertical header (of the row).
60 \code
61 BoxPlotSeries {
62 HBoxPlotModelMapper {
63 model: myCustomModel // QAbstractItemModel derived implementation
64 firstBoxSetRow: 1
65 lastBoxSetRow: 3
66 firstColumn: 1
67 }
68 }
69 \endcode
70 */
71
72 /*!
73 \property QHBoxPlotModelMapper::series
74 \brief Defines the QBoxPlotSeries object that is used by the mapper.
75
76 All the data in the series is discarded when it is set to the mapper.
77 When new series is specified the old series is disconnected (it preserves its data)
78 */
79 /*!
80 \qmlproperty AbstractBarSeries HBoxPlotModelMapper::series
81 Defines the AbstractBarSeries based object that is used by the mapper. All the data in the series is discarded when it is
82 set to the mapper. When new series is specified the old series is disconnected (it preserves its data).
83 */
84
85 /*!
86 \property QHBoxPlotModelMapper::model
87 \brief Defines the model that is used by the mapper.
88 */
89 /*!
90 \qmlproperty SomeModel HBoxPlotModelMapper::model
91 The QAbstractItemModel based model that is used by the mapper. You need to implement the model
92 and expose it to QML. \note the model has to support adding/removing rows/columns and modifying
93 the data of the cells.
94 */
95
96 /*!
97 \property QHBoxPlotModelMapper::firstBoxSetRow
98 \brief Defines which row of the model is used as the data source for the first box-and-whiskers set.
99
100 Default value is: -1 (invalid mapping)
101 */
102 /*!
103 \qmlproperty int HBoxPlotModelMapper::firstBoxSetRow
104 Defines which row of the model is used as the data source for the first box-and-whiskers set. Default value
105 is: -1 (invalid mapping).
106 */
107
108 /*!
109 \property QHBoxPlotModelMapper::lastBoxSetRow
110 \brief Defines which row of the model is used as the data source for the last box-and-whiskers set.
111
112 Default value is: -1 (invalid mapping)
113 */
114 /*!
115 \qmlproperty int HBoxPlotModelMapper::lastBoxSetRow
116 Defines which row of the model is used as the data source for the last box-and-whiskers set. Default
117 value is: -1 (invalid mapping).
118 */
119
120 /*!
121 \property QHBoxPlotModelMapper::firstColumn
122 \brief Defines which column of the model contains the first values of the QBoxSets in the series.
123
124 Minimal and default value is: 0
125 */
126 /*!
127 \qmlproperty int HBoxPlotModelMapper::firstColumn
128 Defines which column of the model contains the first values of the QBoxSets in the series.
129 The default value is 0.
130 */
131
132 /*!
133 \property QHBoxPlotModelMapper::columnCount
134 \brief Defines the number of column of the model that are mapped as the data for QBoxPlotSeries
135
136 Minimal and default value is: -1 (count limited by the number of columns in the model)
137 */
138 /*!
139 \qmlproperty int HBoxPlotModelMapper::columnCount
140 Defines the number of columns of the model that are mapped as the data for QBoxPlotSeries. The default value is
141 -1 (count limited by the number of columns in the model)
142 */
143
144 /*!
145 \fn void QHBoxPlotModelMapper::seriesReplaced()
146
147 Emitted when the series to which mapper is connected to has changed.
148 */
149
150 /*!
151 \fn void QHBoxPlotModelMapper::modelReplaced()
152
153 Emitted when the model to which mapper is connected to has changed.
154 */
155
156 /*!
157 \fn void QHBoxPlotModelMapper::firstBoxSetRowChanged()
158 Emitted when the firstBoxSetRow has changed.
159 */
160
161 /*!
162 \fn void QHBoxPlotModelMapper::lastBoxSetRowChanged()
163 Emitted when the lastBoxSetRow has changed.
164 */
165
166 /*!
167 \fn void QHBoxPlotModelMapper::firstColumnChanged()
168 Emitted when the firstColumn has changed.
169 */
170
171 /*!
172 \fn void QHBoxPlotModelMapper::columnCountChanged()
173 Emitted when the columnCount has changed.
174 */
175
176 /*!
177 Constructs a mapper object which is a child of \a parent.
178 */
179 QHBoxPlotModelMapper::QHBoxPlotModelMapper(QObject *parent) :
180 QBoxPlotModelMapper(parent)
181 {
182 QBoxPlotModelMapper::setOrientation(Qt::Horizontal);
183 }
184
185 QAbstractItemModel *QHBoxPlotModelMapper::model() const
186 {
187 return QBoxPlotModelMapper::model();
188 }
189
190 void QHBoxPlotModelMapper::setModel(QAbstractItemModel *model)
191 {
192 if (model != QBoxPlotModelMapper::model()) {
193 QBoxPlotModelMapper::setModel(model);
194 emit modelReplaced();
195 }
196 }
197
198 QBoxPlotSeries *QHBoxPlotModelMapper::series() const
199 {
200 return QBoxPlotModelMapper::series();
201 }
202
203 void QHBoxPlotModelMapper::setSeries(QBoxPlotSeries *series)
204 {
205 if (series != QBoxPlotModelMapper::series()) {
206 QBoxPlotModelMapper::setSeries(series);
207 emit seriesReplaced();
208 }
209 }
210
211 int QHBoxPlotModelMapper::firstBoxSetRow() const
212 {
213 return QBoxPlotModelMapper::firstBoxSetSection();
214 }
215
216 void QHBoxPlotModelMapper::setFirstBoxSetRow(int firstBoxSetRow)
217 {
218 if (firstBoxSetRow != firstBoxSetSection()) {
219 QBoxPlotModelMapper::setFirstBoxSetSection(firstBoxSetRow);
220 emit firstBoxSetRowChanged();
221 }
222 }
223
224 int QHBoxPlotModelMapper::lastBoxSetRow() const
225 {
226 return QBoxPlotModelMapper::lastBoxSetSection();
227 }
228
229 void QHBoxPlotModelMapper::setLastBoxSetRow(int lastBoxSetRow)
230 {
231 if (lastBoxSetRow != lastBoxSetSection()) {
232 QBoxPlotModelMapper::setLastBoxSetSection(lastBoxSetRow);
233 emit lastBoxSetRowChanged();
234 }
235 }
236
237 int QHBoxPlotModelMapper::firstColumn() const
238 {
239 return QBoxPlotModelMapper::first();
240 }
241
242 void QHBoxPlotModelMapper::setFirstColumn(int firstColumn)
243 {
244 if (firstColumn != first()) {
245 QBoxPlotModelMapper::setFirst(firstColumn);
246 emit firstColumnChanged();
247 }
248 }
249
250 int QHBoxPlotModelMapper::columnCount() const
251 {
252 return QBoxPlotModelMapper::count();
253 }
254
255 void QHBoxPlotModelMapper::setColumnCount(int columnCount)
256 {
257 if (columnCount != count()) {
258 QBoxPlotModelMapper::setCount(columnCount);
259 emit columnCountChanged();
260 }
261 }
262
263 #include "moc_qhboxplotmodelmapper.cpp"
264
265 QT_CHARTS_END_NAMESPACE
266
@@ -0,0 +1,80
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
5 ** Contact: https://www.qt.io/licensing/
6 **
7 ** This file is part of the Qt Charts module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:GPL$
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see https://www.qt.io/terms-conditions. For further
16 ** information use the contact form at https://www.qt.io/contact-us.
17 **
18 ** GNU General Public License Usage
19 ** Alternatively, this file may be used under the terms of the GNU
20 ** General Public License version 3 or (at your option) any later version
21 ** approved by the KDE Free Qt Foundation. The licenses are as published by
22 ** the Free Software Foundation and appearing in the file LICENSE.GPL3
23 ** included in the packaging of this file. Please review the following
24 ** information to ensure the GNU General Public License requirements will
25 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
26 **
27 ** $QT_END_LICENSE$
28 **
29 ****************************************************************************/
30
31 #ifndef QHBOXPLOTMODELMAPPER_H
32 #define QHBOXPLOTMODELMAPPER_H
33
34 #include <QtCharts/QBoxPlotModelMapper>
35
36 QT_CHARTS_BEGIN_NAMESPACE
37 /* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
38 class QT_CHARTS_EXPORT QHBoxPlotModelMapper : public QBoxPlotModelMapper
39 {
40 Q_OBJECT
41 Q_PROPERTY(QBoxPlotSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
42 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
43 Q_PROPERTY(int firstBoxSetRow READ firstBoxSetRow WRITE setFirstBoxSetRow NOTIFY firstBoxSetRowChanged)
44 Q_PROPERTY(int lastBoxSetRow READ lastBoxSetRow WRITE setLastBoxSetRow NOTIFY lastBoxSetRowChanged)
45 Q_PROPERTY(int firstColumn READ firstColumn WRITE setFirstColumn NOTIFY firstColumnChanged)
46 Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount NOTIFY columnCountChanged)
47
48 public:
49 explicit QHBoxPlotModelMapper(QObject *parent = nullptr);
50
51 QAbstractItemModel *model() const;
52 void setModel(QAbstractItemModel *model);
53
54 QBoxPlotSeries *series() const;
55 void setSeries(QBoxPlotSeries *series);
56
57 int firstBoxSetRow() const;
58 void setFirstBoxSetRow(int firstBoxSetRow);
59
60 int lastBoxSetRow() const;
61 void setLastBoxSetRow(int lastBoxSetRow);
62
63 int firstColumn() const;
64 void setFirstColumn(int firstColumn);
65
66 int columnCount() const;
67 void setColumnCount(int rowCount);
68
69 Q_SIGNALS:
70 void seriesReplaced();
71 void modelReplaced();
72 void firstBoxSetRowChanged();
73 void lastBoxSetRowChanged();
74 void firstColumnChanged();
75 void columnCountChanged();
76 };
77
78 QT_CHARTS_END_NAMESPACE
79
80 #endif // QHBOXPLOTMODELMAPPER_H
@@ -1,25 +1,27
1 INCLUDEPATH += $$PWD
1 INCLUDEPATH += $$PWD
2 DEPENDPATH += $$PWD
2 DEPENDPATH += $$PWD
3
3
4 SOURCES += \
4 SOURCES += \
5 $$PWD/boxplotchartitem.cpp \
5 $$PWD/boxplotchartitem.cpp \
6 $$PWD/qboxplotseries.cpp \
6 $$PWD/qboxplotseries.cpp \
7 $$PWD/boxwhiskers.cpp \
7 $$PWD/boxwhiskers.cpp \
8 $$PWD/qboxset.cpp \
8 $$PWD/qboxset.cpp \
9 $$PWD/qboxplotmodelmapper.cpp \
9 $$PWD/qboxplotmodelmapper.cpp \
10 $$PWD/qhboxplotmodelmapper.cpp \
10 $$PWD/qvboxplotmodelmapper.cpp
11 $$PWD/qvboxplotmodelmapper.cpp
11
12
12 PRIVATE_HEADERS += \
13 PRIVATE_HEADERS += \
13 $$PWD/boxplotchartitem_p.h \
14 $$PWD/boxplotchartitem_p.h \
14 $$PWD/qboxplotseries_p.h \
15 $$PWD/qboxplotseries_p.h \
15 $$PWD/boxwhiskers_p.h \
16 $$PWD/boxwhiskers_p.h \
16 $$PWD/boxwhiskersdata_p.h \
17 $$PWD/boxwhiskersdata_p.h \
17 $$PWD/qboxset_p.h \
18 $$PWD/qboxset_p.h \
18 $$PWD/qboxplotmodelmapper_p.h
19 $$PWD/qboxplotmodelmapper_p.h
19
20
20 PUBLIC_HEADERS += \
21 PUBLIC_HEADERS += \
21 $$PWD/qboxplotseries.h \
22 $$PWD/qboxplotseries.h \
22 $$PWD/qboxset.h \
23 $$PWD/qboxset.h \
23 $$PWD/qboxplotmodelmapper.h \
24 $$PWD/qboxplotmodelmapper.h \
25 $$PWD/qhboxplotmodelmapper.h \
24 $$PWD/qvboxplotmodelmapper.h
26 $$PWD/qvboxplotmodelmapper.h
25
27
@@ -1,265 +1,265
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
4 ** Contact: https://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module of the Qt Toolkit.
6 ** This file is part of the Qt Charts module of the Qt Toolkit.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:GPL$
8 ** $QT_BEGIN_LICENSE:GPL$
9 ** Commercial License Usage
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
11 ** accordance with the commercial 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 The Qt Company. For licensing terms
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
16 **
17 ** GNU General Public License Usage
17 ** GNU General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU
18 ** Alternatively, this file may be used under the terms of the GNU
19 ** General Public License version 3 or (at your option) any later version
19 ** General Public License version 3 or (at your option) any later version
20 ** approved by the KDE Free Qt Foundation. The licenses are as published by
20 ** approved by the KDE Free Qt Foundation. The licenses are as published by
21 ** the Free Software Foundation and appearing in the file LICENSE.GPL3
21 ** the Free Software Foundation and appearing in the file LICENSE.GPL3
22 ** included in the packaging of this file. Please review the following
22 ** included in the packaging of this file. Please review the following
23 ** information to ensure the GNU General Public License requirements will
23 ** information to ensure the GNU General Public License requirements will
24 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
25 **
25 **
26 ** $QT_END_LICENSE$
26 ** $QT_END_LICENSE$
27 **
27 **
28 ****************************************************************************/
28 ****************************************************************************/
29
29
30 #include <QtCharts/QVBoxPlotModelMapper>
30 #include <QtCharts/QVBoxPlotModelMapper>
31
31
32 QT_CHARTS_BEGIN_NAMESPACE
32 QT_CHARTS_BEGIN_NAMESPACE
33
33
34 /*!
34 /*!
35 \class QVBoxPlotModelMapper
35 \class QVBoxPlotModelMapper
36 \inmodule Qt Charts
36 \inmodule Qt Charts
37 \brief Vertical model mapper for box plot series.
37 \brief Vertical model mapper for box plot series.
38
38
39 Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series.
39 Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series.
40 Vertical model mapper is used to create a connection between QBoxPlotSeries and QAbstractItemModel derived model object.
40 Vertical model mapper is used to create a connection between QBoxPlotSeries and QAbstractItemModel derived model object.
41 Model mapper maintains equal size of all the QBoxSets.
41 Model mapper maintains equal size of all the QBoxSets.
42 \note used model has to support adding/removing rows/columns and modifying the data of the cells.
42 \note used model has to support adding/removing rows/columns and modifying the data of the cells.
43 */
43 */
44 /*!
44 /*!
45 \qmltype VBoxPlotModelMapper
45 \qmltype VBoxPlotModelMapper
46 \instantiates QVBoxPlotModelMapper
46 \instantiates QVBoxPlotModelMapper
47 \inqmlmodule QtCharts
47 \inqmlmodule QtCharts
48
48
49 \brief Vertical model mapper for box plot series.
49 \brief Vertical model mapper for box plot series.
50
50
51 VBoxPlotModelMapper allows you to use your own QAbstractItemModel derived model with data in
51 VBoxPlotModelMapper allows you to use your own QAbstractItemModel derived model with data in
52 columns as a data source for any box-and-whiskers series. It is possible to use both
52 columns as a data source for any box-and-whiskers series. It is possible to use both
53 QAbstractItemModel and box-and-whiskers series data API to manipulate data. VBoxPlotModelMapper
53 QAbstractItemModel and box-and-whiskers series data API to manipulate data. VBoxPlotModelMapper
54 keeps the series and the model in sync.
54 keeps the series and the model in sync.
55
55
56 The following QML example would create a box-and-whiskers series with three box sets (assuming
56 The following QML example would create a box-and-whiskers series with three box sets (assuming
57 the model has at least four columns). Each box set would contain data starting from row 1. The
57 the model has at least four columns). Each box set would contain data starting from row 1. The
58 name of a set would be defined by the horizontal header (of the column).
58 name of a set would be defined by the horizontal header (of the column).
59 \code
59 \code
60 BoxPlotSeries {
60 BoxPlotSeries {
61 VBoxPlotModelMapper {
61 VBoxPlotModelMapper {
62 model: myCustomModel // QAbstractItemModel derived implementation
62 model: myCustomModel // QAbstractItemModel derived implementation
63 firstBoxSetColumn: 1
63 firstBoxSetColumn: 1
64 lastBoxSetColumn: 3
64 lastBoxSetColumn: 3
65 firstRow: 1
65 firstRow: 1
66 }
66 }
67 }
67 }
68 \endcode
68 \endcode
69 */
69 */
70
70
71 /*!
71 /*!
72 \property QVBoxPlotModelMapper::series
72 \property QVBoxPlotModelMapper::series
73 \brief Defines the QBoxPlotSeries object that is used by the mapper.
73 \brief Defines the QBoxPlotSeries object that is used by the mapper.
74
74
75 All the data in the series is discarded when it is set to the mapper.
75 All the data in the series is discarded when it is set to the mapper.
76 When new series is specified the old series is disconnected (it preserves its data)
76 When new series is specified the old series is disconnected (it preserves its data)
77 */
77 */
78 /*!
78 /*!
79 \qmlproperty AbstractBarSeries VBoxPlotModelMapper::series
79 \qmlproperty AbstractBarSeries VBoxPlotModelMapper::series
80 Defines the AbstractBarSeries based object that is used by the mapper. All the data in the series is discarded when it is
80 Defines the AbstractBarSeries based object that is used by the mapper. All the data in the series is discarded when it is
81 set to the mapper. When new series is specified the old series is disconnected (it preserves its data).
81 set to the mapper. When new series is specified the old series is disconnected (it preserves its data).
82 */
82 */
83
83
84 /*!
84 /*!
85 \property QVBoxPlotModelMapper::model
85 \property QVBoxPlotModelMapper::model
86 \brief Defines the model that is used by the mapper.
86 \brief Defines the model that is used by the mapper.
87 */
87 */
88 /*!
88 /*!
89 \qmlproperty SomeModel VBoxPlotModelMapper::model
89 \qmlproperty SomeModel VBoxPlotModelMapper::model
90 The QAbstractItemModel based model that is used by the mapper. You need to implement the model
90 The QAbstractItemModel based model that is used by the mapper. You need to implement the model
91 and expose it to QML. \note the model has to support adding/removing rows/columns and modifying
91 and expose it to QML. \note the model has to support adding/removing rows/columns and modifying
92 the data of the cells.
92 the data of the cells.
93 */
93 */
94
94
95 /*!
95 /*!
96 \property QVBoxPlotModelMapper::firstBoxSetColumn
96 \property QVBoxPlotModelMapper::firstBoxSetColumn
97 \brief Defines which column of the model is used as the data source for the first box-and-whiskers set.
97 \brief Defines which column of the model is used as the data source for the first box-and-whiskers set.
98
98
99 Default value is: -1 (invalid mapping)
99 Default value is: -1 (invalid mapping)
100 */
100 */
101 /*!
101 /*!
102 \qmlproperty int VBarModelMapper::firstBoxSetColumn
102 \qmlproperty int VBoxPlotModelMapper::firstBoxSetColumn
103 Defines which column of the model is used as the data source for the first box-and-whiskers set. Default value
103 Defines which column of the model is used as the data source for the first box-and-whiskers set. Default value
104 is: -1 (invalid mapping).
104 is: -1 (invalid mapping).
105 */
105 */
106
106
107 /*!
107 /*!
108 \property QVBoxPlotModelMapper::lastBoxSetColumn
108 \property QVBoxPlotModelMapper::lastBoxSetColumn
109 \brief Defines which column of the model is used as the data source for the last box-and-whiskers set.
109 \brief Defines which column of the model is used as the data source for the last box-and-whiskers set.
110
110
111 Default value is: -1 (invalid mapping)
111 Default value is: -1 (invalid mapping)
112 */
112 */
113 /*!
113 /*!
114 \qmlproperty int VBarModelMapper::lastBoxSetColumn
114 \qmlproperty int VBoxPlotModelMapper::lastBoxSetColumn
115 Defines which column of the model is used as the data source for the last box-and-whiskers set. Default
115 Defines which column of the model is used as the data source for the last box-and-whiskers set. Default
116 value is: -1 (invalid mapping).
116 value is: -1 (invalid mapping).
117 */
117 */
118
118
119 /*!
119 /*!
120 \property QVBoxPlotModelMapper::firstRow
120 \property QVBoxPlotModelMapper::firstRow
121 \brief Defines which row of the model contains the first values of the QBoxSets in the series.
121 \brief Defines which row of the model contains the first values of the QBoxSets in the series.
122
122
123 Minimal and default value is: 0
123 Minimal and default value is: 0
124 */
124 */
125 /*!
125 /*!
126 \qmlproperty int VBoxPlotModelMapper::firstRow
126 \qmlproperty int VBoxPlotModelMapper::firstRow
127 Defines which row of the model contains the first values of the QBoxSets in the series.
127 Defines which row of the model contains the first values of the QBoxSets in the series.
128 The default value is 0.
128 The default value is 0.
129 */
129 */
130
130
131 /*!
131 /*!
132 \property QVBoxPlotModelMapper::rowCount
132 \property QVBoxPlotModelMapper::rowCount
133 \brief Defines the number of rows of the model that are mapped as the data for QBoxPlotSeries
133 \brief Defines the number of rows of the model that are mapped as the data for QBoxPlotSeries
134
134
135 Minimal and default value is: -1 (count limited by the number of rows in the model)
135 Minimal and default value is: -1 (count limited by the number of rows in the model)
136 */
136 */
137 /*!
137 /*!
138 \qmlproperty int VBoxModelMapper::rowCount
138 \qmlproperty int VBoxPlotModelMapper::rowCount
139 Defines the number of rows of the model that are mapped as the data for QBoxPlotSeries. The default value is
139 Defines the number of rows of the model that are mapped as the data for QBoxPlotSeries. The default value is
140 -1 (count limited by the number of rows in the model)
140 -1 (count limited by the number of rows in the model)
141 */
141 */
142
142
143 /*!
143 /*!
144 \fn void QVBoxPlotModelMapper::seriesReplaced()
144 \fn void QVBoxPlotModelMapper::seriesReplaced()
145
145
146 Emitted when the series to which mapper is connected to has changed.
146 Emitted when the series to which mapper is connected to has changed.
147 */
147 */
148
148
149 /*!
149 /*!
150 \fn void QVBoxPlotModelMapper::modelReplaced()
150 \fn void QVBoxPlotModelMapper::modelReplaced()
151
151
152 Emitted when the model to which mapper is connected to has changed.
152 Emitted when the model to which mapper is connected to has changed.
153 */
153 */
154
154
155 /*!
155 /*!
156 \fn void QVBoxPlotModelMapper::firstBoxSetColumnChanged()
156 \fn void QVBoxPlotModelMapper::firstBoxSetColumnChanged()
157 Emitted when the firstBoxSetColumn has changed.
157 Emitted when the firstBoxSetColumn has changed.
158 */
158 */
159
159
160 /*!
160 /*!
161 \fn void QVBoxPlotModelMapper::lastBoxSetColumnChanged()
161 \fn void QVBoxPlotModelMapper::lastBoxSetColumnChanged()
162 Emitted when the lastBoxSetColumn has changed.
162 Emitted when the lastBoxSetColumn has changed.
163 */
163 */
164
164
165 /*!
165 /*!
166 \fn void QVBoxPlotModelMapper::firstRowChanged()
166 \fn void QVBoxPlotModelMapper::firstRowChanged()
167 Emitted when the firstRow has changed.
167 Emitted when the firstRow has changed.
168 */
168 */
169
169
170 /*!
170 /*!
171 \fn void QVBoxPlotModelMapper::rowCountChanged()
171 \fn void QVBoxPlotModelMapper::rowCountChanged()
172 Emitted when the rowCount has changed.
172 Emitted when the rowCount has changed.
173 */
173 */
174
174
175 /*!
175 /*!
176 Constructs a mapper object which is a child of \a parent.
176 Constructs a mapper object which is a child of \a parent.
177 */
177 */
178 QVBoxPlotModelMapper::QVBoxPlotModelMapper(QObject *parent) :
178 QVBoxPlotModelMapper::QVBoxPlotModelMapper(QObject *parent) :
179 QBoxPlotModelMapper(parent)
179 QBoxPlotModelMapper(parent)
180 {
180 {
181 QBoxPlotModelMapper::setOrientation(Qt::Vertical);
181 QBoxPlotModelMapper::setOrientation(Qt::Vertical);
182 }
182 }
183
183
184 QAbstractItemModel *QVBoxPlotModelMapper::model() const
184 QAbstractItemModel *QVBoxPlotModelMapper::model() const
185 {
185 {
186 return QBoxPlotModelMapper::model();
186 return QBoxPlotModelMapper::model();
187 }
187 }
188
188
189 void QVBoxPlotModelMapper::setModel(QAbstractItemModel *model)
189 void QVBoxPlotModelMapper::setModel(QAbstractItemModel *model)
190 {
190 {
191 if (model != QBoxPlotModelMapper::model()) {
191 if (model != QBoxPlotModelMapper::model()) {
192 QBoxPlotModelMapper::setModel(model);
192 QBoxPlotModelMapper::setModel(model);
193 emit modelReplaced();
193 emit modelReplaced();
194 }
194 }
195 }
195 }
196
196
197 QBoxPlotSeries *QVBoxPlotModelMapper::series() const
197 QBoxPlotSeries *QVBoxPlotModelMapper::series() const
198 {
198 {
199 return QBoxPlotModelMapper::series();
199 return QBoxPlotModelMapper::series();
200 }
200 }
201
201
202 void QVBoxPlotModelMapper::setSeries(QBoxPlotSeries *series)
202 void QVBoxPlotModelMapper::setSeries(QBoxPlotSeries *series)
203 {
203 {
204 if (series != QBoxPlotModelMapper::series()) {
204 if (series != QBoxPlotModelMapper::series()) {
205 QBoxPlotModelMapper::setSeries(series);
205 QBoxPlotModelMapper::setSeries(series);
206 emit seriesReplaced();
206 emit seriesReplaced();
207 }
207 }
208 }
208 }
209
209
210 int QVBoxPlotModelMapper::firstBoxSetColumn() const
210 int QVBoxPlotModelMapper::firstBoxSetColumn() const
211 {
211 {
212 return QBoxPlotModelMapper::firstBoxSetSection();
212 return QBoxPlotModelMapper::firstBoxSetSection();
213 }
213 }
214
214
215 void QVBoxPlotModelMapper::setFirstBoxSetColumn(int firstBoxSetColumn)
215 void QVBoxPlotModelMapper::setFirstBoxSetColumn(int firstBoxSetColumn)
216 {
216 {
217 if (firstBoxSetColumn != firstBoxSetSection()) {
217 if (firstBoxSetColumn != firstBoxSetSection()) {
218 QBoxPlotModelMapper::setFirstBoxSetSection(firstBoxSetColumn);
218 QBoxPlotModelMapper::setFirstBoxSetSection(firstBoxSetColumn);
219 emit firstBoxSetColumnChanged();
219 emit firstBoxSetColumnChanged();
220 }
220 }
221 }
221 }
222
222
223 int QVBoxPlotModelMapper::lastBoxSetColumn() const
223 int QVBoxPlotModelMapper::lastBoxSetColumn() const
224 {
224 {
225 return QBoxPlotModelMapper::lastBoxSetSection();
225 return QBoxPlotModelMapper::lastBoxSetSection();
226 }
226 }
227
227
228 void QVBoxPlotModelMapper::setLastBoxSetColumn(int lastBoxSetColumn)
228 void QVBoxPlotModelMapper::setLastBoxSetColumn(int lastBoxSetColumn)
229 {
229 {
230 if (lastBoxSetColumn != lastBoxSetSection()) {
230 if (lastBoxSetColumn != lastBoxSetSection()) {
231 QBoxPlotModelMapper::setLastBoxSetSection(lastBoxSetColumn);
231 QBoxPlotModelMapper::setLastBoxSetSection(lastBoxSetColumn);
232 emit lastBoxSetColumnChanged();
232 emit lastBoxSetColumnChanged();
233 }
233 }
234 }
234 }
235
235
236 int QVBoxPlotModelMapper::firstRow() const
236 int QVBoxPlotModelMapper::firstRow() const
237 {
237 {
238 return QBoxPlotModelMapper::first();
238 return QBoxPlotModelMapper::first();
239 }
239 }
240
240
241 void QVBoxPlotModelMapper::setFirstRow(int firstRow)
241 void QVBoxPlotModelMapper::setFirstRow(int firstRow)
242 {
242 {
243 if (firstRow != first()) {
243 if (firstRow != first()) {
244 QBoxPlotModelMapper::setFirst(firstRow);
244 QBoxPlotModelMapper::setFirst(firstRow);
245 emit firstRowChanged();
245 emit firstRowChanged();
246 }
246 }
247 }
247 }
248
248
249 int QVBoxPlotModelMapper::rowCount() const
249 int QVBoxPlotModelMapper::rowCount() const
250 {
250 {
251 return QBoxPlotModelMapper::count();
251 return QBoxPlotModelMapper::count();
252 }
252 }
253
253
254 void QVBoxPlotModelMapper::setRowCount(int rowCount)
254 void QVBoxPlotModelMapper::setRowCount(int rowCount)
255 {
255 {
256 if (rowCount != count()) {
256 if (rowCount != count()) {
257 QBoxPlotModelMapper::setCount(rowCount);
257 QBoxPlotModelMapper::setCount(rowCount);
258 emit rowCountChanged();
258 emit rowCountChanged();
259 }
259 }
260 }
260 }
261
261
262 #include "moc_qvboxplotmodelmapper.cpp"
262 #include "moc_qvboxplotmodelmapper.cpp"
263
263
264 QT_CHARTS_END_NAMESPACE
264 QT_CHARTS_END_NAMESPACE
265
265
@@ -1,333 +1,336
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
4 ** Contact: https://www.qt.io/licensing/
5 **
5 **
6 ** This file is part of the Qt Charts module of the Qt Toolkit.
6 ** This file is part of the Qt Charts module of the Qt Toolkit.
7 **
7 **
8 ** $QT_BEGIN_LICENSE:GPL$
8 ** $QT_BEGIN_LICENSE:GPL$
9 ** Commercial License Usage
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
11 ** accordance with the commercial 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 The Qt Company. For licensing terms
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
16 **
17 ** GNU General Public License Usage
17 ** GNU General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU
18 ** Alternatively, this file may be used under the terms of the GNU
19 ** General Public License version 3 or (at your option) any later version
19 ** General Public License version 3 or (at your option) any later version
20 ** approved by the KDE Free Qt Foundation. The licenses are as published by
20 ** approved by the KDE Free Qt Foundation. The licenses are as published by
21 ** the Free Software Foundation and appearing in the file LICENSE.GPL3
21 ** the Free Software Foundation and appearing in the file LICENSE.GPL3
22 ** included in the packaging of this file. Please review the following
22 ** included in the packaging of this file. Please review the following
23 ** information to ensure the GNU General Public License requirements will
23 ** information to ensure the GNU General Public License requirements will
24 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
25 **
25 **
26 ** $QT_END_LICENSE$
26 ** $QT_END_LICENSE$
27 **
27 **
28 ****************************************************************************/
28 ****************************************************************************/
29
29
30 #include <QtCharts/QChart>
30 #include <QtCharts/QChart>
31 #include <QtCharts/QAbstractAxis>
31 #include <QtCharts/QAbstractAxis>
32 #include <QtCharts/QValueAxis>
32 #include <QtCharts/QValueAxis>
33 #include <QtCharts/QLogValueAxis>
33 #include <QtCharts/QLogValueAxis>
34 #include "declarativecategoryaxis.h"
34 #include "declarativecategoryaxis.h"
35 #include <QtCharts/QBarCategoryAxis>
35 #include <QtCharts/QBarCategoryAxis>
36 #include "declarativechart.h"
36 #include "declarativechart.h"
37 #include "declarativepolarchart.h"
37 #include "declarativepolarchart.h"
38 #include "declarativexypoint.h"
38 #include "declarativexypoint.h"
39 #include "declarativelineseries.h"
39 #include "declarativelineseries.h"
40 #include "declarativesplineseries.h"
40 #include "declarativesplineseries.h"
41 #include "declarativeareaseries.h"
41 #include "declarativeareaseries.h"
42 #include "declarativescatterseries.h"
42 #include "declarativescatterseries.h"
43 #include "declarativebarseries.h"
43 #include "declarativebarseries.h"
44 #include "declarativeboxplotseries.h"
44 #include "declarativeboxplotseries.h"
45 #include "declarativepieseries.h"
45 #include "declarativepieseries.h"
46 #include "declarativeaxes.h"
46 #include "declarativeaxes.h"
47 #include <QtCharts/QVXYModelMapper>
47 #include <QtCharts/QVXYModelMapper>
48 #include <QtCharts/QHXYModelMapper>
48 #include <QtCharts/QHXYModelMapper>
49 #include <QtCharts/QHPieModelMapper>
49 #include <QtCharts/QHPieModelMapper>
50 #include <QtCharts/QVPieModelMapper>
50 #include <QtCharts/QVPieModelMapper>
51 #include <QtCharts/QHBarModelMapper>
51 #include <QtCharts/QHBarModelMapper>
52 #include <QtCharts/QVBarModelMapper>
52 #include <QtCharts/QVBarModelMapper>
53 #include "declarativemargins.h"
53 #include "declarativemargins.h"
54 #include <QtCharts/QAreaLegendMarker>
54 #include <QtCharts/QAreaLegendMarker>
55 #include <QtCharts/QBarLegendMarker>
55 #include <QtCharts/QBarLegendMarker>
56 #include <QtCharts/QPieLegendMarker>
56 #include <QtCharts/QPieLegendMarker>
57 #include <QtCharts/QXYLegendMarker>
57 #include <QtCharts/QXYLegendMarker>
58 #include <QtCharts/QBoxPlotModelMapper>
58 #include <QtCharts/QBoxPlotModelMapper>
59 #include <QtCharts/QHBoxPlotModelMapper>
59 #include <QtCharts/QVBoxPlotModelMapper>
60 #include <QtCharts/QVBoxPlotModelMapper>
60 #ifndef QT_QREAL_IS_FLOAT
61 #ifndef QT_QREAL_IS_FLOAT
61 #include <QtCharts/QDateTimeAxis>
62 #include <QtCharts/QDateTimeAxis>
62 #endif
63 #endif
63 #include <QtCore/QAbstractItemModel>
64 #include <QtCore/QAbstractItemModel>
64 #include <QtQml>
65 #include <QtQml>
65
66
66 QT_CHARTS_USE_NAMESPACE
67 QT_CHARTS_USE_NAMESPACE
67
68
68 QML_DECLARE_TYPE(QList<QPieSlice *>)
69 QML_DECLARE_TYPE(QList<QPieSlice *>)
69 QML_DECLARE_TYPE(QList<QBarSet *>)
70 QML_DECLARE_TYPE(QList<QBarSet *>)
70 QML_DECLARE_TYPE(QList<QAbstractAxis *>)
71 QML_DECLARE_TYPE(QList<QAbstractAxis *>)
71
72
72 QML_DECLARE_TYPE(DeclarativeChart)
73 QML_DECLARE_TYPE(DeclarativeChart)
73 QML_DECLARE_TYPE(DeclarativePolarChart)
74 QML_DECLARE_TYPE(DeclarativePolarChart)
74 QML_DECLARE_TYPE(DeclarativeMargins)
75 QML_DECLARE_TYPE(DeclarativeMargins)
75 QML_DECLARE_TYPE(DeclarativeAreaSeries)
76 QML_DECLARE_TYPE(DeclarativeAreaSeries)
76 QML_DECLARE_TYPE(DeclarativeBarSeries)
77 QML_DECLARE_TYPE(DeclarativeBarSeries)
77 QML_DECLARE_TYPE(DeclarativeBarSet)
78 QML_DECLARE_TYPE(DeclarativeBarSet)
78 QML_DECLARE_TYPE(DeclarativeBoxPlotSeries)
79 QML_DECLARE_TYPE(DeclarativeBoxPlotSeries)
79 QML_DECLARE_TYPE(DeclarativeBoxSet)
80 QML_DECLARE_TYPE(DeclarativeBoxSet)
80 QML_DECLARE_TYPE(DeclarativeLineSeries)
81 QML_DECLARE_TYPE(DeclarativeLineSeries)
81 QML_DECLARE_TYPE(DeclarativePieSeries)
82 QML_DECLARE_TYPE(DeclarativePieSeries)
82 QML_DECLARE_TYPE(DeclarativePieSlice)
83 QML_DECLARE_TYPE(DeclarativePieSlice)
83 QML_DECLARE_TYPE(DeclarativeScatterSeries)
84 QML_DECLARE_TYPE(DeclarativeScatterSeries)
84 QML_DECLARE_TYPE(DeclarativeSplineSeries)
85 QML_DECLARE_TYPE(DeclarativeSplineSeries)
85
86
86 QML_DECLARE_TYPE(QAbstractAxis)
87 QML_DECLARE_TYPE(QAbstractAxis)
87 QML_DECLARE_TYPE(QValueAxis)
88 QML_DECLARE_TYPE(QValueAxis)
88 QML_DECLARE_TYPE(QBarCategoryAxis)
89 QML_DECLARE_TYPE(QBarCategoryAxis)
89 QML_DECLARE_TYPE(QCategoryAxis)
90 QML_DECLARE_TYPE(QCategoryAxis)
90 #ifndef QT_QREAL_IS_FLOAT
91 #ifndef QT_QREAL_IS_FLOAT
91 QML_DECLARE_TYPE(QDateTimeAxis)
92 QML_DECLARE_TYPE(QDateTimeAxis)
92 #endif
93 #endif
93 QML_DECLARE_TYPE(QLogValueAxis)
94 QML_DECLARE_TYPE(QLogValueAxis)
94
95
95 QML_DECLARE_TYPE(QLegend)
96 QML_DECLARE_TYPE(QLegend)
96 QML_DECLARE_TYPE(QLegendMarker)
97 QML_DECLARE_TYPE(QLegendMarker)
97 QML_DECLARE_TYPE(QAreaLegendMarker)
98 QML_DECLARE_TYPE(QAreaLegendMarker)
98 QML_DECLARE_TYPE(QBarLegendMarker)
99 QML_DECLARE_TYPE(QBarLegendMarker)
99 QML_DECLARE_TYPE(QPieLegendMarker)
100 QML_DECLARE_TYPE(QPieLegendMarker)
100
101
101 QML_DECLARE_TYPE(QHPieModelMapper)
102 QML_DECLARE_TYPE(QHPieModelMapper)
102 QML_DECLARE_TYPE(QHXYModelMapper)
103 QML_DECLARE_TYPE(QHXYModelMapper)
103 QML_DECLARE_TYPE(QPieModelMapper)
104 QML_DECLARE_TYPE(QPieModelMapper)
104 QML_DECLARE_TYPE(QHBarModelMapper)
105 QML_DECLARE_TYPE(QHBarModelMapper)
105 QML_DECLARE_TYPE(QBarModelMapper)
106 QML_DECLARE_TYPE(QBarModelMapper)
106 QML_DECLARE_TYPE(QVBarModelMapper)
107 QML_DECLARE_TYPE(QVBarModelMapper)
107 QML_DECLARE_TYPE(QVPieModelMapper)
108 QML_DECLARE_TYPE(QVPieModelMapper)
108 QML_DECLARE_TYPE(QVXYModelMapper)
109 QML_DECLARE_TYPE(QVXYModelMapper)
109 QML_DECLARE_TYPE(QXYLegendMarker)
110 QML_DECLARE_TYPE(QXYLegendMarker)
110 QML_DECLARE_TYPE(QXYModelMapper)
111 QML_DECLARE_TYPE(QXYModelMapper)
111 QML_DECLARE_TYPE(QBoxPlotModelMapper)
112 QML_DECLARE_TYPE(QBoxPlotModelMapper)
113 QML_DECLARE_TYPE(QHBoxPlotModelMapper)
112 QML_DECLARE_TYPE(QVBoxPlotModelMapper)
114 QML_DECLARE_TYPE(QVBoxPlotModelMapper)
113
115
114 QML_DECLARE_TYPE(QAbstractSeries)
116 QML_DECLARE_TYPE(QAbstractSeries)
115 QML_DECLARE_TYPE(QXYSeries)
117 QML_DECLARE_TYPE(QXYSeries)
116 QML_DECLARE_TYPE(QAbstractBarSeries)
118 QML_DECLARE_TYPE(QAbstractBarSeries)
117 QML_DECLARE_TYPE(QBarSeries)
119 QML_DECLARE_TYPE(QBarSeries)
118 QML_DECLARE_TYPE(QBarSet)
120 QML_DECLARE_TYPE(QBarSet)
119 QML_DECLARE_TYPE(QAreaSeries)
121 QML_DECLARE_TYPE(QAreaSeries)
120 QML_DECLARE_TYPE(QHorizontalBarSeries)
122 QML_DECLARE_TYPE(QHorizontalBarSeries)
121 QML_DECLARE_TYPE(QHorizontalPercentBarSeries)
123 QML_DECLARE_TYPE(QHorizontalPercentBarSeries)
122 QML_DECLARE_TYPE(QHorizontalStackedBarSeries)
124 QML_DECLARE_TYPE(QHorizontalStackedBarSeries)
123 QML_DECLARE_TYPE(QLineSeries)
125 QML_DECLARE_TYPE(QLineSeries)
124 QML_DECLARE_TYPE(QPercentBarSeries)
126 QML_DECLARE_TYPE(QPercentBarSeries)
125 QML_DECLARE_TYPE(QPieSeries)
127 QML_DECLARE_TYPE(QPieSeries)
126 QML_DECLARE_TYPE(QPieSlice)
128 QML_DECLARE_TYPE(QPieSlice)
127 QML_DECLARE_TYPE(QScatterSeries)
129 QML_DECLARE_TYPE(QScatterSeries)
128 QML_DECLARE_TYPE(QSplineSeries)
130 QML_DECLARE_TYPE(QSplineSeries)
129 QML_DECLARE_TYPE(QStackedBarSeries)
131 QML_DECLARE_TYPE(QStackedBarSeries)
130
132
131 QT_CHARTS_BEGIN_NAMESPACE
133 QT_CHARTS_BEGIN_NAMESPACE
132
134
133 class QtChartsQml2Plugin : public QQmlExtensionPlugin
135 class QtChartsQml2Plugin : public QQmlExtensionPlugin
134 {
136 {
135 Q_OBJECT
137 Q_OBJECT
136
138
137 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
139 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
138
140
139 public:
141 public:
140 virtual void registerTypes(const char *uri)
142 virtual void registerTypes(const char *uri)
141 {
143 {
142 Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCharts"));
144 Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCharts"));
143
145
144 // @uri QtCharts
146 // @uri QtCharts
145
147
146 qRegisterMetaType<QList<QPieSlice *> >();
148 qRegisterMetaType<QList<QPieSlice *> >();
147 qRegisterMetaType<QList<QBarSet *> >();
149 qRegisterMetaType<QList<QBarSet *> >();
148 qRegisterMetaType<QList<QAbstractAxis *> >();
150 qRegisterMetaType<QList<QAbstractAxis *> >();
149
151
150 // QtCharts 1.0
152 // QtCharts 1.0
151 qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView");
153 qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView");
152 qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint");
154 qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint");
153 qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries");
155 qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries");
154 qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries");
156 qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries");
155 qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries");
157 qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries");
156 qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries");
158 qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries");
157 qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries");
159 qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries");
158 qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries");
160 qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries");
159 qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries");
161 qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries");
160 qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries");
162 qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries");
161 qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice");
163 qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice");
162 qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet");
164 qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet");
163 qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper");
165 qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper");
164 qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper");
166 qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper");
165 qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper");
167 qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper");
166 qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper");
168 qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper");
167 qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper");
169 qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper");
168 qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper");
170 qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper");
169
171
170 qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis");
172 qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis");
171 qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis");
173 qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis");
172 qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend",
174 qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend",
173 QLatin1String("Trying to create uncreatable: Legend."));
175 QLatin1String("Trying to create uncreatable: Legend."));
174 qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries",
176 qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries",
175 QLatin1String("Trying to create uncreatable: XYSeries."));
177 QLatin1String("Trying to create uncreatable: XYSeries."));
176 qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel",
178 qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel",
177 QLatin1String("Trying to create uncreatable: AbstractItemModel."));
179 QLatin1String("Trying to create uncreatable: AbstractItemModel."));
178 qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper",
180 qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper",
179 QLatin1String("Trying to create uncreatable: XYModelMapper."));
181 QLatin1String("Trying to create uncreatable: XYModelMapper."));
180 qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper",
182 qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper",
181 QLatin1String("Trying to create uncreatable: PieModelMapper."));
183 QLatin1String("Trying to create uncreatable: PieModelMapper."));
182 qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper",
184 qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper",
183 QLatin1String("Trying to create uncreatable: BarModelMapper."));
185 QLatin1String("Trying to create uncreatable: BarModelMapper."));
184 qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries",
186 qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries",
185 QLatin1String("Trying to create uncreatable: AbstractSeries."));
187 QLatin1String("Trying to create uncreatable: AbstractSeries."));
186 qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries",
188 qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries",
187 QLatin1String("Trying to create uncreatable: AbstractBarSeries."));
189 QLatin1String("Trying to create uncreatable: AbstractBarSeries."));
188 qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis",
190 qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis",
189 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
191 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
190 qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "BarSetBase",
192 qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "BarSetBase",
191 QLatin1String("Trying to create uncreatable: BarsetBase."));
193 QLatin1String("Trying to create uncreatable: BarsetBase."));
192 qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries",
194 qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries",
193 QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead."));
195 QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead."));
194 qmlRegisterUncreatableType<DeclarativeAxes>(uri, 1, 0, "DeclarativeAxes",
196 qmlRegisterUncreatableType<DeclarativeAxes>(uri, 1, 0, "DeclarativeAxes",
195 QLatin1String("Trying to create uncreatable: DeclarativeAxes."));
197 QLatin1String("Trying to create uncreatable: DeclarativeAxes."));
196
198
197 // QtCharts 1.1
199 // QtCharts 1.1
198 qmlRegisterType<DeclarativeChart, 1>(uri, 1, 1, "ChartView");
200 qmlRegisterType<DeclarativeChart, 1>(uri, 1, 1, "ChartView");
199 qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries");
201 qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries");
200 qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries");
202 qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries");
201 qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries");
203 qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries");
202 qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries");
204 qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries");
203 qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries");
205 qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries");
204 qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries");
206 qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries");
205 qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries");
207 qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries");
206 qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries");
208 qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries");
207 qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries");
209 qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries");
208 qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries");
210 qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries");
209 qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries");
211 qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries");
210 qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet");
212 qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet");
211 qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis");
213 qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis");
212 #ifndef QT_QREAL_IS_FLOAT
214 #ifndef QT_QREAL_IS_FLOAT
213 qmlRegisterType<QDateTimeAxis>(uri, 1, 1, "DateTimeAxis");
215 qmlRegisterType<QDateTimeAxis>(uri, 1, 1, "DateTimeAxis");
214 #endif
216 #endif
215 qmlRegisterType<DeclarativeCategoryAxis>(uri, 1, 1, "CategoryAxis");
217 qmlRegisterType<DeclarativeCategoryAxis>(uri, 1, 1, "CategoryAxis");
216 qmlRegisterType<DeclarativeCategoryRange>(uri, 1, 1, "CategoryRange");
218 qmlRegisterType<DeclarativeCategoryRange>(uri, 1, 1, "CategoryRange");
217 qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis");
219 qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis");
218 qmlRegisterUncreatableType<DeclarativeMargins>(uri, 1, 1, "Margins",
220 qmlRegisterUncreatableType<DeclarativeMargins>(uri, 1, 1, "Margins",
219 QLatin1String("Trying to create uncreatable: Margins."));
221 QLatin1String("Trying to create uncreatable: Margins."));
220
222
221 // QtCharts 1.2
223 // QtCharts 1.2
222 qmlRegisterType<DeclarativeChart, 2>(uri, 1, 2, "ChartView");
224 qmlRegisterType<DeclarativeChart, 2>(uri, 1, 2, "ChartView");
223 qmlRegisterType<DeclarativeScatterSeries, 2>(uri, 1, 2, "ScatterSeries");
225 qmlRegisterType<DeclarativeScatterSeries, 2>(uri, 1, 2, "ScatterSeries");
224 qmlRegisterType<DeclarativeLineSeries, 2>(uri, 1, 2, "LineSeries");
226 qmlRegisterType<DeclarativeLineSeries, 2>(uri, 1, 2, "LineSeries");
225 qmlRegisterType<DeclarativeSplineSeries, 2>(uri, 1, 2, "SplineSeries");
227 qmlRegisterType<DeclarativeSplineSeries, 2>(uri, 1, 2, "SplineSeries");
226 qmlRegisterType<DeclarativeAreaSeries, 2>(uri, 1, 2, "AreaSeries");
228 qmlRegisterType<DeclarativeAreaSeries, 2>(uri, 1, 2, "AreaSeries");
227 qmlRegisterType<DeclarativeBarSeries, 2>(uri, 1, 2, "BarSeries");
229 qmlRegisterType<DeclarativeBarSeries, 2>(uri, 1, 2, "BarSeries");
228 qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, 1, 2, "StackedBarSeries");
230 qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, 1, 2, "StackedBarSeries");
229 qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, 1, 2, "PercentBarSeries");
231 qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, 1, 2, "PercentBarSeries");
230 qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, 1, 2, "HorizontalBarSeries");
232 qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, 1, 2, "HorizontalBarSeries");
231 qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, 1, 2, "HorizontalStackedBarSeries");
233 qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, 1, 2, "HorizontalStackedBarSeries");
232 qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, 1, 2, "HorizontalPercentBarSeries");
234 qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, 1, 2, "HorizontalPercentBarSeries");
233
235
234 // QtCharts 1.3
236 // QtCharts 1.3
235 qmlRegisterType<DeclarativeChart, 3>(uri, 1, 3, "ChartView");
237 qmlRegisterType<DeclarativeChart, 3>(uri, 1, 3, "ChartView");
236 qmlRegisterType<DeclarativePolarChart, 1>(uri, 1, 3, "PolarChartView");
238 qmlRegisterType<DeclarativePolarChart, 1>(uri, 1, 3, "PolarChartView");
237 qmlRegisterType<DeclarativeSplineSeries, 3>(uri, 1, 3, "SplineSeries");
239 qmlRegisterType<DeclarativeSplineSeries, 3>(uri, 1, 3, "SplineSeries");
238 qmlRegisterType<DeclarativeScatterSeries, 3>(uri, 1, 3, "ScatterSeries");
240 qmlRegisterType<DeclarativeScatterSeries, 3>(uri, 1, 3, "ScatterSeries");
239 qmlRegisterType<DeclarativeLineSeries, 3>(uri, 1, 3, "LineSeries");
241 qmlRegisterType<DeclarativeLineSeries, 3>(uri, 1, 3, "LineSeries");
240 qmlRegisterType<DeclarativeAreaSeries, 3>(uri, 1, 3, "AreaSeries");
242 qmlRegisterType<DeclarativeAreaSeries, 3>(uri, 1, 3, "AreaSeries");
241 qmlRegisterType<QLogValueAxis>(uri, 1, 3, "LogValueAxis");
243 qmlRegisterType<QLogValueAxis>(uri, 1, 3, "LogValueAxis");
242 qmlRegisterType<DeclarativeBoxPlotSeries>(uri, 1, 3, "BoxPlotSeries");
244 qmlRegisterType<DeclarativeBoxPlotSeries>(uri, 1, 3, "BoxPlotSeries");
243 qmlRegisterType<DeclarativeBoxSet>(uri, 1, 3, "BoxSet");
245 qmlRegisterType<DeclarativeBoxSet>(uri, 1, 3, "BoxSet");
244
246
245 // QtCharts 1.4
247 // QtCharts 1.4
246 qmlRegisterType<DeclarativeAreaSeries, 4>(uri, 1, 4, "AreaSeries");
248 qmlRegisterType<DeclarativeAreaSeries, 4>(uri, 1, 4, "AreaSeries");
247 qmlRegisterType<DeclarativeBarSet, 2>(uri, 1, 4, "BarSet");
249 qmlRegisterType<DeclarativeBarSet, 2>(uri, 1, 4, "BarSet");
248 qmlRegisterType<DeclarativeBoxPlotSeries, 1>(uri, 1, 4, "BoxPlotSeries");
250 qmlRegisterType<DeclarativeBoxPlotSeries, 1>(uri, 1, 4, "BoxPlotSeries");
249 qmlRegisterType<DeclarativeBoxSet, 1>(uri, 1, 4, "BoxSet");
251 qmlRegisterType<DeclarativeBoxSet, 1>(uri, 1, 4, "BoxSet");
250 qmlRegisterType<DeclarativePieSlice>(uri, 1, 4, "PieSlice");
252 qmlRegisterType<DeclarativePieSlice>(uri, 1, 4, "PieSlice");
251 qmlRegisterType<DeclarativeScatterSeries, 4>(uri, 1, 4, "ScatterSeries");
253 qmlRegisterType<DeclarativeScatterSeries, 4>(uri, 1, 4, "ScatterSeries");
252
254
253 // QtCharts 2.0
255 // QtCharts 2.0
256 qmlRegisterType<QHBoxPlotModelMapper>(uri, 2, 0, "HBoxPlotModelMapper");
254 qmlRegisterType<QVBoxPlotModelMapper>(uri, 2, 0, "VBoxPlotModelMapper");
257 qmlRegisterType<QVBoxPlotModelMapper>(uri, 2, 0, "VBoxPlotModelMapper");
255 qmlRegisterUncreatableType<QBoxPlotModelMapper>(uri, 2, 0, "BoxPlotModelMapper",
258 qmlRegisterUncreatableType<QBoxPlotModelMapper>(uri, 2, 0, "BoxPlotModelMapper",
256 QLatin1String("Trying to create uncreatable: BoxPlotModelMapper."));
259 QLatin1String("Trying to create uncreatable: BoxPlotModelMapper."));
257 qmlRegisterType<DeclarativeChart, 4>(uri, 2, 0, "ChartView");
260 qmlRegisterType<DeclarativeChart, 4>(uri, 2, 0, "ChartView");
258 qmlRegisterType<DeclarativeXYPoint>(uri, 2, 0, "XYPoint");
261 qmlRegisterType<DeclarativeXYPoint>(uri, 2, 0, "XYPoint");
259 qmlRegisterType<DeclarativeScatterSeries, 4>(uri, 2, 0, "ScatterSeries");
262 qmlRegisterType<DeclarativeScatterSeries, 4>(uri, 2, 0, "ScatterSeries");
260 qmlRegisterType<DeclarativeLineSeries, 3>(uri, 2, 0, "LineSeries");
263 qmlRegisterType<DeclarativeLineSeries, 3>(uri, 2, 0, "LineSeries");
261 qmlRegisterType<DeclarativeSplineSeries, 3>(uri, 2, 0, "SplineSeries");
264 qmlRegisterType<DeclarativeSplineSeries, 3>(uri, 2, 0, "SplineSeries");
262 qmlRegisterType<DeclarativeAreaSeries, 4>(uri, 2, 0, "AreaSeries");
265 qmlRegisterType<DeclarativeAreaSeries, 4>(uri, 2, 0, "AreaSeries");
263 qmlRegisterType<DeclarativeBarSeries, 2>(uri, 2, 0, "BarSeries");
266 qmlRegisterType<DeclarativeBarSeries, 2>(uri, 2, 0, "BarSeries");
264 qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, 2, 0, "StackedBarSeries");
267 qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, 2, 0, "StackedBarSeries");
265 qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, 2, 0, "PercentBarSeries");
268 qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, 2, 0, "PercentBarSeries");
266 qmlRegisterType<DeclarativePieSeries>(uri, 2, 0, "PieSeries");
269 qmlRegisterType<DeclarativePieSeries>(uri, 2, 0, "PieSeries");
267 qmlRegisterType<QPieSlice>(uri, 2, 0, "PieSlice");
270 qmlRegisterType<QPieSlice>(uri, 2, 0, "PieSlice");
268 qmlRegisterType<DeclarativeBarSet, 2>(uri, 2, 0, "BarSet");
271 qmlRegisterType<DeclarativeBarSet, 2>(uri, 2, 0, "BarSet");
269 qmlRegisterType<QHXYModelMapper>(uri, 2, 0, "HXYModelMapper");
272 qmlRegisterType<QHXYModelMapper>(uri, 2, 0, "HXYModelMapper");
270 qmlRegisterType<QVXYModelMapper>(uri, 2, 0, "VXYModelMapper");
273 qmlRegisterType<QVXYModelMapper>(uri, 2, 0, "VXYModelMapper");
271 qmlRegisterType<QHPieModelMapper>(uri, 2, 0, "HPieModelMapper");
274 qmlRegisterType<QHPieModelMapper>(uri, 2, 0, "HPieModelMapper");
272 qmlRegisterType<QVPieModelMapper>(uri, 2, 0, "VPieModelMapper");
275 qmlRegisterType<QVPieModelMapper>(uri, 2, 0, "VPieModelMapper");
273 qmlRegisterType<QHBarModelMapper>(uri, 2, 0, "HBarModelMapper");
276 qmlRegisterType<QHBarModelMapper>(uri, 2, 0, "HBarModelMapper");
274 qmlRegisterType<QVBarModelMapper>(uri, 2, 0, "VBarModelMapper");
277 qmlRegisterType<QVBarModelMapper>(uri, 2, 0, "VBarModelMapper");
275 qmlRegisterType<QValueAxis>(uri, 2, 0, "ValueAxis");
278 qmlRegisterType<QValueAxis>(uri, 2, 0, "ValueAxis");
276 #ifndef QT_QREAL_IS_FLOAT
279 #ifndef QT_QREAL_IS_FLOAT
277 qmlRegisterType<QDateTimeAxis>(uri, 2, 0, "DateTimeAxis");
280 qmlRegisterType<QDateTimeAxis>(uri, 2, 0, "DateTimeAxis");
278 #endif
281 #endif
279 qmlRegisterType<DeclarativeCategoryAxis>(uri, 2, 0, "CategoryAxis");
282 qmlRegisterType<DeclarativeCategoryAxis>(uri, 2, 0, "CategoryAxis");
280 qmlRegisterType<DeclarativeCategoryRange>(uri, 2, 0, "CategoryRange");
283 qmlRegisterType<DeclarativeCategoryRange>(uri, 2, 0, "CategoryRange");
281 qmlRegisterType<QBarCategoryAxis>(uri, 2, 0, "BarCategoryAxis");
284 qmlRegisterType<QBarCategoryAxis>(uri, 2, 0, "BarCategoryAxis");
282 qmlRegisterType<DeclarativePolarChart, 1>(uri, 2, 0, "PolarChartView");
285 qmlRegisterType<DeclarativePolarChart, 1>(uri, 2, 0, "PolarChartView");
283 qmlRegisterType<QLogValueAxis, 1>(uri, 2, 0, "LogValueAxis");
286 qmlRegisterType<QLogValueAxis, 1>(uri, 2, 0, "LogValueAxis");
284 qmlRegisterType<DeclarativeBoxPlotSeries, 1>(uri, 2, 0, "BoxPlotSeries");
287 qmlRegisterType<DeclarativeBoxPlotSeries, 1>(uri, 2, 0, "BoxPlotSeries");
285 qmlRegisterType<DeclarativeBoxSet, 1>(uri, 2, 0, "BoxSet");
288 qmlRegisterType<DeclarativeBoxSet, 1>(uri, 2, 0, "BoxSet");
286 qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, 2, 0, "HorizontalBarSeries");
289 qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, 2, 0, "HorizontalBarSeries");
287 qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, 2, 0, "HorizontalStackedBarSeries");
290 qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, 2, 0, "HorizontalStackedBarSeries");
288 qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, 2, 0, "HorizontalPercentBarSeries");
291 qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, 2, 0, "HorizontalPercentBarSeries");
289 qmlRegisterType<DeclarativePieSlice>(uri, 2, 0, "PieSlice");
292 qmlRegisterType<DeclarativePieSlice>(uri, 2, 0, "PieSlice");
290 qmlRegisterUncreatableType<QLegend>(uri, 2, 0, "Legend",
293 qmlRegisterUncreatableType<QLegend>(uri, 2, 0, "Legend",
291 QLatin1String("Trying to create uncreatable: Legend."));
294 QLatin1String("Trying to create uncreatable: Legend."));
292 qmlRegisterUncreatableType<QXYSeries>(uri, 2, 0, "XYSeries",
295 qmlRegisterUncreatableType<QXYSeries>(uri, 2, 0, "XYSeries",
293 QLatin1String("Trying to create uncreatable: XYSeries."));
296 QLatin1String("Trying to create uncreatable: XYSeries."));
294 qmlRegisterUncreatableType<QAbstractItemModel>(uri, 2, 0, "AbstractItemModel",
297 qmlRegisterUncreatableType<QAbstractItemModel>(uri, 2, 0, "AbstractItemModel",
295 QLatin1String("Trying to create uncreatable: AbstractItemModel."));
298 QLatin1String("Trying to create uncreatable: AbstractItemModel."));
296 qmlRegisterUncreatableType<QXYModelMapper>(uri, 2, 0, "XYModelMapper",
299 qmlRegisterUncreatableType<QXYModelMapper>(uri, 2, 0, "XYModelMapper",
297 QLatin1String("Trying to create uncreatable: XYModelMapper."));
300 QLatin1String("Trying to create uncreatable: XYModelMapper."));
298 qmlRegisterUncreatableType<QPieModelMapper>(uri, 2, 0, "PieModelMapper",
301 qmlRegisterUncreatableType<QPieModelMapper>(uri, 2, 0, "PieModelMapper",
299 QLatin1String("Trying to create uncreatable: PieModelMapper."));
302 QLatin1String("Trying to create uncreatable: PieModelMapper."));
300 qmlRegisterUncreatableType<QBarModelMapper>(uri, 2, 0, "BarModelMapper",
303 qmlRegisterUncreatableType<QBarModelMapper>(uri, 2, 0, "BarModelMapper",
301 QLatin1String("Trying to create uncreatable: BarModelMapper."));
304 QLatin1String("Trying to create uncreatable: BarModelMapper."));
302 qmlRegisterUncreatableType<QAbstractSeries>(uri, 2, 0, "AbstractSeries",
305 qmlRegisterUncreatableType<QAbstractSeries>(uri, 2, 0, "AbstractSeries",
303 QLatin1String("Trying to create uncreatable: AbstractSeries."));
306 QLatin1String("Trying to create uncreatable: AbstractSeries."));
304 qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 2, 0, "AbstractBarSeries",
307 qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 2, 0, "AbstractBarSeries",
305 QLatin1String("Trying to create uncreatable: AbstractBarSeries."));
308 QLatin1String("Trying to create uncreatable: AbstractBarSeries."));
306 qmlRegisterUncreatableType<QAbstractAxis>(uri, 2, 0, "AbstractAxis",
309 qmlRegisterUncreatableType<QAbstractAxis>(uri, 2, 0, "AbstractAxis",
307 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
310 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
308 qmlRegisterUncreatableType<QBarSet>(uri, 2, 0, "BarSetBase",
311 qmlRegisterUncreatableType<QBarSet>(uri, 2, 0, "BarSetBase",
309 QLatin1String("Trying to create uncreatable: BarsetBase."));
312 QLatin1String("Trying to create uncreatable: BarsetBase."));
310 qmlRegisterUncreatableType<QPieSeries>(uri, 2, 0, "QPieSeries",
313 qmlRegisterUncreatableType<QPieSeries>(uri, 2, 0, "QPieSeries",
311 QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead."));
314 QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead."));
312 qmlRegisterUncreatableType<DeclarativeAxes>(uri, 2, 0, "DeclarativeAxes",
315 qmlRegisterUncreatableType<DeclarativeAxes>(uri, 2, 0, "DeclarativeAxes",
313 QLatin1String("Trying to create uncreatable: DeclarativeAxes."));
316 QLatin1String("Trying to create uncreatable: DeclarativeAxes."));
314 qmlRegisterUncreatableType<DeclarativeMargins>(uri, 2, 0, "Margins",
317 qmlRegisterUncreatableType<DeclarativeMargins>(uri, 2, 0, "Margins",
315 QLatin1String("Trying to create uncreatable: Margins."));
318 QLatin1String("Trying to create uncreatable: Margins."));
316
319
317 // QtCharts 2.1
320 // QtCharts 2.1
318 qmlRegisterType<DeclarativeCategoryAxis, 1>(uri, 2, 1, "CategoryAxis");
321 qmlRegisterType<DeclarativeCategoryAxis, 1>(uri, 2, 1, "CategoryAxis");
319 qmlRegisterUncreatableType<QAbstractAxis>(uri, 2, 1, "AbstractAxis",
322 qmlRegisterUncreatableType<QAbstractAxis>(uri, 2, 1, "AbstractAxis",
320 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
323 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
321 qmlRegisterType<DeclarativeChart, 5>(uri, 2, 1, "ChartView");
324 qmlRegisterType<DeclarativeChart, 5>(uri, 2, 1, "ChartView");
322 qmlRegisterType<DeclarativeScatterSeries, 5>(uri, 2, 1, "ScatterSeries");
325 qmlRegisterType<DeclarativeScatterSeries, 5>(uri, 2, 1, "ScatterSeries");
323 qmlRegisterType<DeclarativeLineSeries, 4>(uri, 2, 1, "LineSeries");
326 qmlRegisterType<DeclarativeLineSeries, 4>(uri, 2, 1, "LineSeries");
324 qmlRegisterType<DeclarativeSplineSeries, 4>(uri, 2, 1, "SplineSeries");
327 qmlRegisterType<DeclarativeSplineSeries, 4>(uri, 2, 1, "SplineSeries");
325 }
328 }
326
329
327 };
330 };
328
331
329 QT_CHARTS_END_NAMESPACE
332 QT_CHARTS_END_NAMESPACE
330
333
331 #include "chartsqml2_plugin.moc"
334 #include "chartsqml2_plugin.moc"
332
335
333 QT_CHARTS_USE_NAMESPACE
336 QT_CHARTS_USE_NAMESPACE
General Comments 0
You need to be logged in to leave comments. Login now