1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the Qt Charts module of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:GPL$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
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 |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU General Public License Usage |
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 |
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 |
22 | ** included in the packaging of this file. Please review the following |
23 | ** information to ensure the GNU General Public License requirements will |
24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
25 | ** |
26 | ** $QT_END_LICENSE$ |
27 | ** |
28 | ****************************************************************************/ |
29 | |
30 | #include <QtCharts/QChart> |
31 | #include <QtCharts/QAbstractAxis> |
32 | #include <QtCharts/QValueAxis> |
33 | #include <QtCharts/QLogValueAxis> |
34 | #include "declarativecategoryaxis_p.h" |
35 | #include <QtCharts/QBarCategoryAxis> |
36 | #include "declarativechart_p.h" |
37 | #include "declarativepolarchart_p.h" |
38 | #include "declarativexypoint_p.h" |
39 | #include "declarativelineseries_p.h" |
40 | #include "declarativesplineseries_p.h" |
41 | #include "declarativeareaseries_p.h" |
42 | #include "declarativescatterseries_p.h" |
43 | #include "declarativebarseries_p.h" |
44 | #include "declarativeboxplotseries_p.h" |
45 | #include "declarativecandlestickseries_p.h" |
46 | #include "declarativepieseries_p.h" |
47 | #include "declarativeaxes_p.h" |
48 | #include <QtCharts/QVXYModelMapper> |
49 | #include <QtCharts/QHXYModelMapper> |
50 | #include <QtCharts/QHPieModelMapper> |
51 | #include <QtCharts/QVPieModelMapper> |
52 | #include <QtCharts/QHBarModelMapper> |
53 | #include <QtCharts/QVBarModelMapper> |
54 | #include "declarativemargins_p.h" |
55 | #include <QtCharts/QAreaLegendMarker> |
56 | #include <QtCharts/QBarLegendMarker> |
57 | #include <QtCharts/QPieLegendMarker> |
58 | #include <QtCharts/QXYLegendMarker> |
59 | #include <QtCharts/QBoxPlotModelMapper> |
60 | #include <QtCharts/QHBoxPlotModelMapper> |
61 | #include <QtCharts/QVBoxPlotModelMapper> |
62 | #include <QtCharts/QCandlestickModelMapper> |
63 | #include <QtCharts/QHCandlestickModelMapper> |
64 | #include <QtCharts/QVCandlestickModelMapper> |
65 | #ifndef QT_QREAL_IS_FLOAT |
66 | #include <QtCharts/QDateTimeAxis> |
67 | #endif |
68 | #include <QtCore/QAbstractItemModel> |
69 | #include <QtQml> |
70 | |
71 | QT_CHARTS_USE_NAMESPACE |
72 | |
73 | QML_DECLARE_TYPE(QList<QPieSlice *>) |
74 | QML_DECLARE_TYPE(QList<QBarSet *>) |
75 | QML_DECLARE_TYPE(QList<QAbstractAxis *>) |
76 | |
77 | QML_DECLARE_TYPE(DeclarativeChart) |
78 | QML_DECLARE_TYPE(DeclarativePolarChart) |
79 | QML_DECLARE_TYPE(DeclarativeMargins) |
80 | QML_DECLARE_TYPE(DeclarativeAreaSeries) |
81 | QML_DECLARE_TYPE(DeclarativeBarSeries) |
82 | QML_DECLARE_TYPE(DeclarativeBarSet) |
83 | QML_DECLARE_TYPE(DeclarativeBoxPlotSeries) |
84 | QML_DECLARE_TYPE(DeclarativeBoxSet) |
85 | QML_DECLARE_TYPE(DeclarativeCandlestickSeries) |
86 | QML_DECLARE_TYPE(DeclarativeCandlestickSet) |
87 | QML_DECLARE_TYPE(DeclarativeLineSeries) |
88 | QML_DECLARE_TYPE(DeclarativePieSeries) |
89 | QML_DECLARE_TYPE(DeclarativePieSlice) |
90 | QML_DECLARE_TYPE(DeclarativeScatterSeries) |
91 | QML_DECLARE_TYPE(DeclarativeSplineSeries) |
92 | |
93 | QML_DECLARE_TYPE(QAbstractAxis) |
94 | QML_DECLARE_TYPE(QValueAxis) |
95 | QML_DECLARE_TYPE(QBarCategoryAxis) |
96 | QML_DECLARE_TYPE(QCategoryAxis) |
97 | #ifndef QT_QREAL_IS_FLOAT |
98 | QML_DECLARE_TYPE(QDateTimeAxis) |
99 | #endif |
100 | QML_DECLARE_TYPE(QLogValueAxis) |
101 | |
102 | QML_DECLARE_TYPE(QLegend) |
103 | QML_DECLARE_TYPE(QLegendMarker) |
104 | QML_DECLARE_TYPE(QAreaLegendMarker) |
105 | QML_DECLARE_TYPE(QBarLegendMarker) |
106 | QML_DECLARE_TYPE(QPieLegendMarker) |
107 | |
108 | QML_DECLARE_TYPE(QHPieModelMapper) |
109 | QML_DECLARE_TYPE(QHXYModelMapper) |
110 | QML_DECLARE_TYPE(QPieModelMapper) |
111 | QML_DECLARE_TYPE(QHBarModelMapper) |
112 | QML_DECLARE_TYPE(QBarModelMapper) |
113 | QML_DECLARE_TYPE(QVBarModelMapper) |
114 | QML_DECLARE_TYPE(QVPieModelMapper) |
115 | QML_DECLARE_TYPE(QVXYModelMapper) |
116 | QML_DECLARE_TYPE(QXYLegendMarker) |
117 | QML_DECLARE_TYPE(QXYModelMapper) |
118 | QML_DECLARE_TYPE(QBoxPlotModelMapper) |
119 | QML_DECLARE_TYPE(QHBoxPlotModelMapper) |
120 | QML_DECLARE_TYPE(QVBoxPlotModelMapper) |
121 | QML_DECLARE_TYPE(QCandlestickModelMapper) |
122 | QML_DECLARE_TYPE(QHCandlestickModelMapper) |
123 | QML_DECLARE_TYPE(QVCandlestickModelMapper) |
124 | |
125 | QML_DECLARE_TYPE(QAbstractSeries) |
126 | QML_DECLARE_TYPE(QXYSeries) |
127 | QML_DECLARE_TYPE(QAbstractBarSeries) |
128 | QML_DECLARE_TYPE(QBarSeries) |
129 | QML_DECLARE_TYPE(QBarSet) |
130 | QML_DECLARE_TYPE(QAreaSeries) |
131 | QML_DECLARE_TYPE(QHorizontalBarSeries) |
132 | QML_DECLARE_TYPE(QHorizontalPercentBarSeries) |
133 | QML_DECLARE_TYPE(QHorizontalStackedBarSeries) |
134 | QML_DECLARE_TYPE(QLineSeries) |
135 | QML_DECLARE_TYPE(QPercentBarSeries) |
136 | QML_DECLARE_TYPE(QPieSeries) |
137 | QML_DECLARE_TYPE(QPieSlice) |
138 | QML_DECLARE_TYPE(QScatterSeries) |
139 | QML_DECLARE_TYPE(QSplineSeries) |
140 | QML_DECLARE_TYPE(QStackedBarSeries) |
141 | |
142 | QT_CHARTS_BEGIN_NAMESPACE |
143 | |
144 | class QtChartsQml2Plugin : public QQmlExtensionPlugin |
145 | { |
146 | Q_OBJECT |
147 | |
148 | Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) |
149 | |
150 | public: |
151 | QtChartsQml2Plugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { } |
152 | virtual void registerTypes(const char *uri) |
153 | { |
154 | Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCharts" )); |
155 | |
156 | // @uri QtCharts |
157 | |
158 | qRegisterMetaType<QList<QPieSlice *> >(); |
159 | qRegisterMetaType<QList<QBarSet *> >(); |
160 | qRegisterMetaType<QList<QAbstractAxis *> >(); |
161 | |
162 | // QtCharts 1.0 |
163 | qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView" ); |
164 | qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint" ); |
165 | qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries" ); |
166 | qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries" ); |
167 | qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries" ); |
168 | qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries" ); |
169 | qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries" ); |
170 | qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries" ); |
171 | qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries" ); |
172 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries" ); |
173 | qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice" ); |
174 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet" ); |
175 | qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper" ); |
176 | qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper" ); |
177 | qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper" ); |
178 | qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper" ); |
179 | qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper" ); |
180 | qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper" ); |
181 | |
182 | qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis" ); |
183 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis" ); |
184 | qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend" , |
185 | QLatin1String("Trying to create uncreatable: Legend." )); |
186 | qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries" , |
187 | QLatin1String("Trying to create uncreatable: XYSeries." )); |
188 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel" , |
189 | QLatin1String("Trying to create uncreatable: AbstractItemModel." )); |
190 | qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper" , |
191 | QLatin1String("Trying to create uncreatable: XYModelMapper." )); |
192 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper" , |
193 | QLatin1String("Trying to create uncreatable: PieModelMapper." )); |
194 | qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper" , |
195 | QLatin1String("Trying to create uncreatable: BarModelMapper." )); |
196 | qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries" , |
197 | QLatin1String("Trying to create uncreatable: AbstractSeries." )); |
198 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries" , |
199 | QLatin1String("Trying to create uncreatable: AbstractBarSeries." )); |
200 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis" , |
201 | QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead." )); |
202 | qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "BarSetBase" , |
203 | QLatin1String("Trying to create uncreatable: BarsetBase." )); |
204 | qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries" , |
205 | QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead." )); |
206 | qmlRegisterUncreatableType<DeclarativeAxes>(uri, 1, 0, "DeclarativeAxes" , |
207 | QLatin1String("Trying to create uncreatable: DeclarativeAxes." )); |
208 | |
209 | // QtCharts 1.1 |
210 | qmlRegisterType<DeclarativeChart, 1>(uri, 1, 1, "ChartView" ); |
211 | qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries" ); |
212 | qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries" ); |
213 | qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries" ); |
214 | qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries" ); |
215 | qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries" ); |
216 | qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries" ); |
217 | qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries" ); |
218 | qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries" ); |
219 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries" ); |
220 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries" ); |
221 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries" ); |
222 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet" ); |
223 | qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis" ); |
224 | #ifndef QT_QREAL_IS_FLOAT |
225 | qmlRegisterType<QDateTimeAxis>(uri, 1, 1, "DateTimeAxis" ); |
226 | #endif |
227 | qmlRegisterType<DeclarativeCategoryAxis>(uri, 1, 1, "CategoryAxis" ); |
228 | qmlRegisterType<DeclarativeCategoryRange>(uri, 1, 1, "CategoryRange" ); |
229 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis" ); |
230 | qmlRegisterUncreatableType<DeclarativeMargins>(uri, 1, 1, "Margins" , |
231 | QLatin1String("Trying to create uncreatable: Margins." )); |
232 | |
233 | // QtCharts 1.2 |
234 | qmlRegisterType<DeclarativeChart, 2>(uri, 1, 2, "ChartView" ); |
235 | qmlRegisterType<DeclarativeScatterSeries, 2>(uri, 1, 2, "ScatterSeries" ); |
236 | qmlRegisterType<DeclarativeLineSeries, 2>(uri, 1, 2, "LineSeries" ); |
237 | qmlRegisterType<DeclarativeSplineSeries, 2>(uri, 1, 2, "SplineSeries" ); |
238 | qmlRegisterType<DeclarativeAreaSeries, 2>(uri, 1, 2, "AreaSeries" ); |
239 | qmlRegisterType<DeclarativeBarSeries, 2>(uri, 1, 2, "BarSeries" ); |
240 | qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, 1, 2, "StackedBarSeries" ); |
241 | qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, 1, 2, "PercentBarSeries" ); |
242 | qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, 1, 2, "HorizontalBarSeries" ); |
243 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, 1, 2, "HorizontalStackedBarSeries" ); |
244 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, 1, 2, "HorizontalPercentBarSeries" ); |
245 | |
246 | // QtCharts 1.3 |
247 | qmlRegisterType<DeclarativeChart, 3>(uri, 1, 3, "ChartView" ); |
248 | qmlRegisterType<DeclarativePolarChart, 1>(uri, 1, 3, "PolarChartView" ); |
249 | qmlRegisterType<DeclarativeSplineSeries, 3>(uri, 1, 3, "SplineSeries" ); |
250 | qmlRegisterType<DeclarativeScatterSeries, 3>(uri, 1, 3, "ScatterSeries" ); |
251 | qmlRegisterType<DeclarativeLineSeries, 3>(uri, 1, 3, "LineSeries" ); |
252 | qmlRegisterType<DeclarativeAreaSeries, 3>(uri, 1, 3, "AreaSeries" ); |
253 | qmlRegisterType<QLogValueAxis>(uri, 1, 3, "LogValueAxis" ); |
254 | qmlRegisterType<DeclarativeBoxPlotSeries>(uri, 1, 3, "BoxPlotSeries" ); |
255 | qmlRegisterType<DeclarativeBoxSet>(uri, 1, 3, "BoxSet" ); |
256 | |
257 | // QtCharts 1.4 |
258 | qmlRegisterType<DeclarativeAreaSeries, 4>(uri, 1, 4, "AreaSeries" ); |
259 | qmlRegisterType<DeclarativeBarSet, 2>(uri, 1, 4, "BarSet" ); |
260 | qmlRegisterType<DeclarativeBoxPlotSeries, 1>(uri, 1, 4, "BoxPlotSeries" ); |
261 | qmlRegisterType<DeclarativeBoxSet, 1>(uri, 1, 4, "BoxSet" ); |
262 | qmlRegisterType<DeclarativePieSlice>(uri, 1, 4, "PieSlice" ); |
263 | qmlRegisterType<DeclarativeScatterSeries, 4>(uri, 1, 4, "ScatterSeries" ); |
264 | |
265 | // QtCharts 2.0 |
266 | qmlRegisterType<QHBoxPlotModelMapper>(uri, 2, 0, "HBoxPlotModelMapper" ); |
267 | qmlRegisterType<QVBoxPlotModelMapper>(uri, 2, 0, "VBoxPlotModelMapper" ); |
268 | qmlRegisterUncreatableType<QBoxPlotModelMapper>(uri, 2, 0, "BoxPlotModelMapper" , |
269 | QLatin1String("Trying to create uncreatable: BoxPlotModelMapper." )); |
270 | qmlRegisterType<DeclarativeChart, 4>(uri, 2, 0, "ChartView" ); |
271 | qmlRegisterType<DeclarativeXYPoint>(uri, 2, 0, "XYPoint" ); |
272 | qmlRegisterType<DeclarativeScatterSeries, 4>(uri, 2, 0, "ScatterSeries" ); |
273 | qmlRegisterType<DeclarativeLineSeries, 3>(uri, 2, 0, "LineSeries" ); |
274 | qmlRegisterType<DeclarativeSplineSeries, 3>(uri, 2, 0, "SplineSeries" ); |
275 | qmlRegisterType<DeclarativeAreaSeries, 4>(uri, 2, 0, "AreaSeries" ); |
276 | qmlRegisterType<DeclarativeBarSeries, 2>(uri, 2, 0, "BarSeries" ); |
277 | qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, 2, 0, "StackedBarSeries" ); |
278 | qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, 2, 0, "PercentBarSeries" ); |
279 | qmlRegisterType<DeclarativePieSeries>(uri, 2, 0, "PieSeries" ); |
280 | qmlRegisterType<QPieSlice>(uri, 2, 0, "PieSlice" ); |
281 | qmlRegisterType<DeclarativeBarSet, 2>(uri, 2, 0, "BarSet" ); |
282 | qmlRegisterType<QHXYModelMapper>(uri, 2, 0, "HXYModelMapper" ); |
283 | qmlRegisterType<QVXYModelMapper>(uri, 2, 0, "VXYModelMapper" ); |
284 | qmlRegisterType<QHPieModelMapper>(uri, 2, 0, "HPieModelMapper" ); |
285 | qmlRegisterType<QVPieModelMapper>(uri, 2, 0, "VPieModelMapper" ); |
286 | qmlRegisterType<QHBarModelMapper>(uri, 2, 0, "HBarModelMapper" ); |
287 | qmlRegisterType<QVBarModelMapper>(uri, 2, 0, "VBarModelMapper" ); |
288 | qmlRegisterType<QValueAxis>(uri, 2, 0, "ValueAxis" ); |
289 | #ifndef QT_QREAL_IS_FLOAT |
290 | qmlRegisterType<QDateTimeAxis>(uri, 2, 0, "DateTimeAxis" ); |
291 | #endif |
292 | qmlRegisterType<DeclarativeCategoryAxis>(uri, 2, 0, "CategoryAxis" ); |
293 | qmlRegisterType<DeclarativeCategoryRange>(uri, 2, 0, "CategoryRange" ); |
294 | qmlRegisterType<QBarCategoryAxis>(uri, 2, 0, "BarCategoryAxis" ); |
295 | qmlRegisterType<DeclarativePolarChart, 1>(uri, 2, 0, "PolarChartView" ); |
296 | qmlRegisterType<QLogValueAxis, 1>(uri, 2, 0, "LogValueAxis" ); |
297 | qmlRegisterType<DeclarativeBoxPlotSeries, 1>(uri, 2, 0, "BoxPlotSeries" ); |
298 | qmlRegisterType<DeclarativeBoxSet, 1>(uri, 2, 0, "BoxSet" ); |
299 | qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, 2, 0, "HorizontalBarSeries" ); |
300 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, 2, 0, "HorizontalStackedBarSeries" ); |
301 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, 2, 0, "HorizontalPercentBarSeries" ); |
302 | qmlRegisterType<DeclarativePieSlice>(uri, 2, 0, "PieSlice" ); |
303 | qmlRegisterUncreatableType<QLegend>(uri, 2, 0, "Legend" , |
304 | QLatin1String("Trying to create uncreatable: Legend." )); |
305 | qmlRegisterUncreatableType<QXYSeries>(uri, 2, 0, "XYSeries" , |
306 | QLatin1String("Trying to create uncreatable: XYSeries." )); |
307 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 2, 0, "AbstractItemModel" , |
308 | QLatin1String("Trying to create uncreatable: AbstractItemModel." )); |
309 | qmlRegisterUncreatableType<QXYModelMapper>(uri, 2, 0, "XYModelMapper" , |
310 | QLatin1String("Trying to create uncreatable: XYModelMapper." )); |
311 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 2, 0, "PieModelMapper" , |
312 | QLatin1String("Trying to create uncreatable: PieModelMapper." )); |
313 | qmlRegisterUncreatableType<QBarModelMapper>(uri, 2, 0, "BarModelMapper" , |
314 | QLatin1String("Trying to create uncreatable: BarModelMapper." )); |
315 | qmlRegisterUncreatableType<QAbstractSeries>(uri, 2, 0, "AbstractSeries" , |
316 | QLatin1String("Trying to create uncreatable: AbstractSeries." )); |
317 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 2, 0, "AbstractBarSeries" , |
318 | QLatin1String("Trying to create uncreatable: AbstractBarSeries." )); |
319 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 2, 0, "AbstractAxis" , |
320 | QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead." )); |
321 | qmlRegisterUncreatableType<QBarSet>(uri, 2, 0, "BarSetBase" , |
322 | QLatin1String("Trying to create uncreatable: BarsetBase." )); |
323 | qmlRegisterUncreatableType<QPieSeries>(uri, 2, 0, "QPieSeries" , |
324 | QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead." )); |
325 | qmlRegisterUncreatableType<DeclarativeAxes>(uri, 2, 0, "DeclarativeAxes" , |
326 | QLatin1String("Trying to create uncreatable: DeclarativeAxes." )); |
327 | qmlRegisterUncreatableType<DeclarativeMargins>(uri, 2, 0, "Margins" , |
328 | QLatin1String("Trying to create uncreatable: Margins." )); |
329 | |
330 | // QtCharts 2.1 |
331 | qmlRegisterType<DeclarativeCategoryAxis, 1>(uri, 2, 1, "CategoryAxis" ); |
332 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 2, 1, "AbstractAxis" , |
333 | QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead." )); |
334 | qmlRegisterType<DeclarativeChart, 5>(uri, 2, 1, "ChartView" ); |
335 | qmlRegisterType<DeclarativeScatterSeries, 5>(uri, 2, 1, "ScatterSeries" ); |
336 | qmlRegisterType<DeclarativeLineSeries, 4>(uri, 2, 1, "LineSeries" ); |
337 | qmlRegisterType<DeclarativeSplineSeries, 4>(uri, 2, 1, "SplineSeries" ); |
338 | |
339 | // QtCharts 2.2 |
340 | qmlRegisterType<DeclarativeCandlestickSeries>(uri, 2, 2, "CandlestickSeries" ); |
341 | qmlRegisterType<DeclarativeCandlestickSet>(uri, 2, 2, "CandlestickSet" ); |
342 | qmlRegisterUncreatableType<QCandlestickModelMapper>(uri, 2, 2, "CandlestickModelMapper" , |
343 | QLatin1String("Trying to create uncreatable: CandlestickModelMapper." )); |
344 | qmlRegisterType<QHCandlestickModelMapper>(uri, 2, 2, "HCandlestickModelMapper" ); |
345 | qmlRegisterType<QVCandlestickModelMapper>(uri, 2, 2, "VCandlestickModelMapper" ); |
346 | |
347 | // QtCharts 2.3 |
348 | qmlRegisterType<QValueAxis, 1>(uri, 2, 3, "ValueAxis" ); |
349 | |
350 | // Auto-increment the import to stay in sync with ALL future QtQuick minor versions |
351 | qmlRegisterModule(uri, 2, QT_VERSION_MINOR); |
352 | } |
353 | |
354 | }; |
355 | |
356 | QT_CHARTS_END_NAMESPACE |
357 | |
358 | #include "chartsqml2_plugin.moc" |
359 | |
360 | QT_CHARTS_USE_NAMESPACE |
361 | |