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, versionMajor: 1, versionMinor: 0, qmlName: "ChartView" ); |
164 | qmlRegisterType<DeclarativeXYPoint>(uri, versionMajor: 1, versionMinor: 0, qmlName: "XYPoint" ); |
165 | qmlRegisterType<DeclarativeScatterSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "ScatterSeries" ); |
166 | qmlRegisterType<DeclarativeLineSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "LineSeries" ); |
167 | qmlRegisterType<DeclarativeSplineSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "SplineSeries" ); |
168 | qmlRegisterType<DeclarativeAreaSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "AreaSeries" ); |
169 | qmlRegisterType<DeclarativeBarSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "BarSeries" ); |
170 | qmlRegisterType<DeclarativeStackedBarSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "StackedBarSeries" ); |
171 | qmlRegisterType<DeclarativePercentBarSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "PercentBarSeries" ); |
172 | qmlRegisterType<DeclarativePieSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "PieSeries" ); |
173 | qmlRegisterType<QPieSlice>(uri, versionMajor: 1, versionMinor: 0, qmlName: "PieSlice" ); |
174 | qmlRegisterType<DeclarativeBarSet>(uri, versionMajor: 1, versionMinor: 0, qmlName: "BarSet" ); |
175 | qmlRegisterType<QHXYModelMapper>(uri, versionMajor: 1, versionMinor: 0, qmlName: "HXYModelMapper" ); |
176 | qmlRegisterType<QVXYModelMapper>(uri, versionMajor: 1, versionMinor: 0, qmlName: "VXYModelMapper" ); |
177 | qmlRegisterType<QHPieModelMapper>(uri, versionMajor: 1, versionMinor: 0, qmlName: "HPieModelMapper" ); |
178 | qmlRegisterType<QVPieModelMapper>(uri, versionMajor: 1, versionMinor: 0, qmlName: "VPieModelMapper" ); |
179 | qmlRegisterType<QHBarModelMapper>(uri, versionMajor: 1, versionMinor: 0, qmlName: "HBarModelMapper" ); |
180 | qmlRegisterType<QVBarModelMapper>(uri, versionMajor: 1, versionMinor: 0, qmlName: "VBarModelMapper" ); |
181 | |
182 | qmlRegisterType<QValueAxis>(uri, versionMajor: 1, versionMinor: 0, qmlName: "ValuesAxis" ); |
183 | qmlRegisterType<QBarCategoryAxis>(uri, versionMajor: 1, versionMinor: 0, qmlName: "BarCategoriesAxis" ); |
184 | qmlRegisterUncreatableType<QLegend>(uri, versionMajor: 1, versionMinor: 0, qmlName: "Legend" , |
185 | reason: QLatin1String("Trying to create uncreatable: Legend." )); |
186 | qmlRegisterUncreatableType<QXYSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "XYSeries" , |
187 | reason: QLatin1String("Trying to create uncreatable: XYSeries." )); |
188 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, versionMajor: 1, versionMinor: 0, qmlName: "AbstractItemModel" , |
189 | reason: QLatin1String("Trying to create uncreatable: AbstractItemModel." )); |
190 | qmlRegisterUncreatableType<QXYModelMapper>(uri, versionMajor: 1, versionMinor: 0, qmlName: "XYModelMapper" , |
191 | reason: QLatin1String("Trying to create uncreatable: XYModelMapper." )); |
192 | qmlRegisterUncreatableType<QPieModelMapper>(uri, versionMajor: 1, versionMinor: 0, qmlName: "PieModelMapper" , |
193 | reason: QLatin1String("Trying to create uncreatable: PieModelMapper." )); |
194 | qmlRegisterUncreatableType<QBarModelMapper>(uri, versionMajor: 1, versionMinor: 0, qmlName: "BarModelMapper" , |
195 | reason: QLatin1String("Trying to create uncreatable: BarModelMapper." )); |
196 | qmlRegisterUncreatableType<QAbstractSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "AbstractSeries" , |
197 | reason: QLatin1String("Trying to create uncreatable: AbstractSeries." )); |
198 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "AbstractBarSeries" , |
199 | reason: QLatin1String("Trying to create uncreatable: AbstractBarSeries." )); |
200 | qmlRegisterUncreatableType<QAbstractAxis>(uri, versionMajor: 1, versionMinor: 0, qmlName: "AbstractAxis" , |
201 | reason: QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead." )); |
202 | qmlRegisterUncreatableType<QBarSet>(uri, versionMajor: 1, versionMinor: 0, qmlName: "BarSetBase" , |
203 | reason: QLatin1String("Trying to create uncreatable: BarsetBase." )); |
204 | qmlRegisterUncreatableType<QPieSeries>(uri, versionMajor: 1, versionMinor: 0, qmlName: "QPieSeries" , |
205 | reason: QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead." )); |
206 | qmlRegisterUncreatableType<DeclarativeAxes>(uri, versionMajor: 1, versionMinor: 0, qmlName: "DeclarativeAxes" , |
207 | reason: QLatin1String("Trying to create uncreatable: DeclarativeAxes." )); |
208 | |
209 | // QtCharts 1.1 |
210 | qmlRegisterType<DeclarativeChart, 1>(uri, versionMajor: 1, versionMinor: 1, qmlName: "ChartView" ); |
211 | qmlRegisterType<DeclarativeScatterSeries, 1>(uri, versionMajor: 1, versionMinor: 1, qmlName: "ScatterSeries" ); |
212 | qmlRegisterType<DeclarativeLineSeries, 1>(uri, versionMajor: 1, versionMinor: 1, qmlName: "LineSeries" ); |
213 | qmlRegisterType<DeclarativeSplineSeries, 1>(uri, versionMajor: 1, versionMinor: 1, qmlName: "SplineSeries" ); |
214 | qmlRegisterType<DeclarativeAreaSeries, 1>(uri, versionMajor: 1, versionMinor: 1, qmlName: "AreaSeries" ); |
215 | qmlRegisterType<DeclarativeBarSeries, 1>(uri, versionMajor: 1, versionMinor: 1, qmlName: "BarSeries" ); |
216 | qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, versionMajor: 1, versionMinor: 1, qmlName: "StackedBarSeries" ); |
217 | qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, versionMajor: 1, versionMinor: 1, qmlName: "PercentBarSeries" ); |
218 | qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, versionMajor: 1, versionMinor: 1, qmlName: "HorizontalBarSeries" ); |
219 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, versionMajor: 1, versionMinor: 1, qmlName: "HorizontalStackedBarSeries" ); |
220 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, versionMajor: 1, versionMinor: 1, qmlName: "HorizontalPercentBarSeries" ); |
221 | qmlRegisterType<DeclarativePieSeries>(uri, versionMajor: 1, versionMinor: 1, qmlName: "PieSeries" ); |
222 | qmlRegisterType<DeclarativeBarSet>(uri, versionMajor: 1, versionMinor: 1, qmlName: "BarSet" ); |
223 | qmlRegisterType<QValueAxis>(uri, versionMajor: 1, versionMinor: 1, qmlName: "ValueAxis" ); |
224 | #ifndef QT_QREAL_IS_FLOAT |
225 | qmlRegisterType<QDateTimeAxis>(uri, versionMajor: 1, versionMinor: 1, qmlName: "DateTimeAxis" ); |
226 | #endif |
227 | qmlRegisterType<DeclarativeCategoryAxis>(uri, versionMajor: 1, versionMinor: 1, qmlName: "CategoryAxis" ); |
228 | qmlRegisterType<DeclarativeCategoryRange>(uri, versionMajor: 1, versionMinor: 1, qmlName: "CategoryRange" ); |
229 | qmlRegisterType<QBarCategoryAxis>(uri, versionMajor: 1, versionMinor: 1, qmlName: "BarCategoryAxis" ); |
230 | qmlRegisterUncreatableType<DeclarativeMargins>(uri, versionMajor: 1, versionMinor: 1, qmlName: "Margins" , |
231 | reason: QLatin1String("Trying to create uncreatable: Margins." )); |
232 | |
233 | // QtCharts 1.2 |
234 | qmlRegisterType<DeclarativeChart, 2>(uri, versionMajor: 1, versionMinor: 2, qmlName: "ChartView" ); |
235 | qmlRegisterType<DeclarativeScatterSeries, 2>(uri, versionMajor: 1, versionMinor: 2, qmlName: "ScatterSeries" ); |
236 | qmlRegisterType<DeclarativeLineSeries, 2>(uri, versionMajor: 1, versionMinor: 2, qmlName: "LineSeries" ); |
237 | qmlRegisterType<DeclarativeSplineSeries, 2>(uri, versionMajor: 1, versionMinor: 2, qmlName: "SplineSeries" ); |
238 | qmlRegisterType<DeclarativeAreaSeries, 2>(uri, versionMajor: 1, versionMinor: 2, qmlName: "AreaSeries" ); |
239 | qmlRegisterType<DeclarativeBarSeries, 2>(uri, versionMajor: 1, versionMinor: 2, qmlName: "BarSeries" ); |
240 | qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, versionMajor: 1, versionMinor: 2, qmlName: "StackedBarSeries" ); |
241 | qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, versionMajor: 1, versionMinor: 2, qmlName: "PercentBarSeries" ); |
242 | qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, versionMajor: 1, versionMinor: 2, qmlName: "HorizontalBarSeries" ); |
243 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, versionMajor: 1, versionMinor: 2, qmlName: "HorizontalStackedBarSeries" ); |
244 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, versionMajor: 1, versionMinor: 2, qmlName: "HorizontalPercentBarSeries" ); |
245 | |
246 | // QtCharts 1.3 |
247 | qmlRegisterType<DeclarativeChart, 3>(uri, versionMajor: 1, versionMinor: 3, qmlName: "ChartView" ); |
248 | qmlRegisterType<DeclarativePolarChart, 1>(uri, versionMajor: 1, versionMinor: 3, qmlName: "PolarChartView" ); |
249 | qmlRegisterType<DeclarativeSplineSeries, 3>(uri, versionMajor: 1, versionMinor: 3, qmlName: "SplineSeries" ); |
250 | qmlRegisterType<DeclarativeScatterSeries, 3>(uri, versionMajor: 1, versionMinor: 3, qmlName: "ScatterSeries" ); |
251 | qmlRegisterType<DeclarativeLineSeries, 3>(uri, versionMajor: 1, versionMinor: 3, qmlName: "LineSeries" ); |
252 | qmlRegisterType<DeclarativeAreaSeries, 3>(uri, versionMajor: 1, versionMinor: 3, qmlName: "AreaSeries" ); |
253 | qmlRegisterType<QLogValueAxis>(uri, versionMajor: 1, versionMinor: 3, qmlName: "LogValueAxis" ); |
254 | qmlRegisterType<DeclarativeBoxPlotSeries>(uri, versionMajor: 1, versionMinor: 3, qmlName: "BoxPlotSeries" ); |
255 | qmlRegisterType<DeclarativeBoxSet>(uri, versionMajor: 1, versionMinor: 3, qmlName: "BoxSet" ); |
256 | |
257 | // QtCharts 1.4 |
258 | qmlRegisterType<DeclarativeAreaSeries, 4>(uri, versionMajor: 1, versionMinor: 4, qmlName: "AreaSeries" ); |
259 | qmlRegisterType<DeclarativeBarSet, 2>(uri, versionMajor: 1, versionMinor: 4, qmlName: "BarSet" ); |
260 | qmlRegisterType<DeclarativeBoxPlotSeries, 1>(uri, versionMajor: 1, versionMinor: 4, qmlName: "BoxPlotSeries" ); |
261 | qmlRegisterType<DeclarativeBoxSet, 1>(uri, versionMajor: 1, versionMinor: 4, qmlName: "BoxSet" ); |
262 | qmlRegisterType<DeclarativePieSlice>(uri, versionMajor: 1, versionMinor: 4, qmlName: "PieSlice" ); |
263 | qmlRegisterType<DeclarativeScatterSeries, 4>(uri, versionMajor: 1, versionMinor: 4, qmlName: "ScatterSeries" ); |
264 | |
265 | // QtCharts 2.0 |
266 | qmlRegisterType<QHBoxPlotModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "HBoxPlotModelMapper" ); |
267 | qmlRegisterType<QVBoxPlotModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "VBoxPlotModelMapper" ); |
268 | qmlRegisterUncreatableType<QBoxPlotModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "BoxPlotModelMapper" , |
269 | reason: QLatin1String("Trying to create uncreatable: BoxPlotModelMapper." )); |
270 | qmlRegisterType<DeclarativeChart, 4>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ChartView" ); |
271 | qmlRegisterType<DeclarativeXYPoint>(uri, versionMajor: 2, versionMinor: 0, qmlName: "XYPoint" ); |
272 | qmlRegisterType<DeclarativeScatterSeries, 4>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ScatterSeries" ); |
273 | qmlRegisterType<DeclarativeLineSeries, 3>(uri, versionMajor: 2, versionMinor: 0, qmlName: "LineSeries" ); |
274 | qmlRegisterType<DeclarativeSplineSeries, 3>(uri, versionMajor: 2, versionMinor: 0, qmlName: "SplineSeries" ); |
275 | qmlRegisterType<DeclarativeAreaSeries, 4>(uri, versionMajor: 2, versionMinor: 0, qmlName: "AreaSeries" ); |
276 | qmlRegisterType<DeclarativeBarSeries, 2>(uri, versionMajor: 2, versionMinor: 0, qmlName: "BarSeries" ); |
277 | qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, versionMajor: 2, versionMinor: 0, qmlName: "StackedBarSeries" ); |
278 | qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, versionMajor: 2, versionMinor: 0, qmlName: "PercentBarSeries" ); |
279 | qmlRegisterType<DeclarativePieSeries>(uri, versionMajor: 2, versionMinor: 0, qmlName: "PieSeries" ); |
280 | qmlRegisterType<QPieSlice>(uri, versionMajor: 2, versionMinor: 0, qmlName: "PieSlice" ); |
281 | qmlRegisterType<DeclarativeBarSet, 2>(uri, versionMajor: 2, versionMinor: 0, qmlName: "BarSet" ); |
282 | qmlRegisterType<QHXYModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "HXYModelMapper" ); |
283 | qmlRegisterType<QVXYModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "VXYModelMapper" ); |
284 | qmlRegisterType<QHPieModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "HPieModelMapper" ); |
285 | qmlRegisterType<QVPieModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "VPieModelMapper" ); |
286 | qmlRegisterType<QHBarModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "HBarModelMapper" ); |
287 | qmlRegisterType<QVBarModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "VBarModelMapper" ); |
288 | qmlRegisterType<QValueAxis>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ValueAxis" ); |
289 | #ifndef QT_QREAL_IS_FLOAT |
290 | qmlRegisterType<QDateTimeAxis>(uri, versionMajor: 2, versionMinor: 0, qmlName: "DateTimeAxis" ); |
291 | #endif |
292 | qmlRegisterType<DeclarativeCategoryAxis>(uri, versionMajor: 2, versionMinor: 0, qmlName: "CategoryAxis" ); |
293 | qmlRegisterType<DeclarativeCategoryRange>(uri, versionMajor: 2, versionMinor: 0, qmlName: "CategoryRange" ); |
294 | qmlRegisterType<QBarCategoryAxis>(uri, versionMajor: 2, versionMinor: 0, qmlName: "BarCategoryAxis" ); |
295 | qmlRegisterType<DeclarativePolarChart, 1>(uri, versionMajor: 2, versionMinor: 0, qmlName: "PolarChartView" ); |
296 | qmlRegisterType<QLogValueAxis, 1>(uri, versionMajor: 2, versionMinor: 0, qmlName: "LogValueAxis" ); |
297 | qmlRegisterType<DeclarativeBoxPlotSeries, 1>(uri, versionMajor: 2, versionMinor: 0, qmlName: "BoxPlotSeries" ); |
298 | qmlRegisterType<DeclarativeBoxSet, 1>(uri, versionMajor: 2, versionMinor: 0, qmlName: "BoxSet" ); |
299 | qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, versionMajor: 2, versionMinor: 0, qmlName: "HorizontalBarSeries" ); |
300 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, versionMajor: 2, versionMinor: 0, qmlName: "HorizontalStackedBarSeries" ); |
301 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, versionMajor: 2, versionMinor: 0, qmlName: "HorizontalPercentBarSeries" ); |
302 | qmlRegisterType<DeclarativePieSlice>(uri, versionMajor: 2, versionMinor: 0, qmlName: "PieSlice" ); |
303 | qmlRegisterUncreatableType<QLegend>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Legend" , |
304 | reason: QLatin1String("Trying to create uncreatable: Legend." )); |
305 | qmlRegisterUncreatableType<QXYSeries>(uri, versionMajor: 2, versionMinor: 0, qmlName: "XYSeries" , |
306 | reason: QLatin1String("Trying to create uncreatable: XYSeries." )); |
307 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, versionMajor: 2, versionMinor: 0, qmlName: "AbstractItemModel" , |
308 | reason: QLatin1String("Trying to create uncreatable: AbstractItemModel." )); |
309 | qmlRegisterUncreatableType<QXYModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "XYModelMapper" , |
310 | reason: QLatin1String("Trying to create uncreatable: XYModelMapper." )); |
311 | qmlRegisterUncreatableType<QPieModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "PieModelMapper" , |
312 | reason: QLatin1String("Trying to create uncreatable: PieModelMapper." )); |
313 | qmlRegisterUncreatableType<QBarModelMapper>(uri, versionMajor: 2, versionMinor: 0, qmlName: "BarModelMapper" , |
314 | reason: QLatin1String("Trying to create uncreatable: BarModelMapper." )); |
315 | qmlRegisterUncreatableType<QAbstractSeries>(uri, versionMajor: 2, versionMinor: 0, qmlName: "AbstractSeries" , |
316 | reason: QLatin1String("Trying to create uncreatable: AbstractSeries." )); |
317 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, versionMajor: 2, versionMinor: 0, qmlName: "AbstractBarSeries" , |
318 | reason: QLatin1String("Trying to create uncreatable: AbstractBarSeries." )); |
319 | qmlRegisterUncreatableType<QAbstractAxis>(uri, versionMajor: 2, versionMinor: 0, qmlName: "AbstractAxis" , |
320 | reason: QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead." )); |
321 | qmlRegisterUncreatableType<QBarSet>(uri, versionMajor: 2, versionMinor: 0, qmlName: "BarSetBase" , |
322 | reason: QLatin1String("Trying to create uncreatable: BarsetBase." )); |
323 | qmlRegisterUncreatableType<QPieSeries>(uri, versionMajor: 2, versionMinor: 0, qmlName: "QPieSeries" , |
324 | reason: QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead." )); |
325 | qmlRegisterUncreatableType<DeclarativeAxes>(uri, versionMajor: 2, versionMinor: 0, qmlName: "DeclarativeAxes" , |
326 | reason: QLatin1String("Trying to create uncreatable: DeclarativeAxes." )); |
327 | qmlRegisterUncreatableType<DeclarativeMargins>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Margins" , |
328 | reason: QLatin1String("Trying to create uncreatable: Margins." )); |
329 | |
330 | // QtCharts 2.1 |
331 | qmlRegisterType<DeclarativeCategoryAxis, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "CategoryAxis" ); |
332 | qmlRegisterUncreatableType<QAbstractAxis>(uri, versionMajor: 2, versionMinor: 1, qmlName: "AbstractAxis" , |
333 | reason: QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead." )); |
334 | qmlRegisterType<DeclarativeChart, 5>(uri, versionMajor: 2, versionMinor: 1, qmlName: "ChartView" ); |
335 | qmlRegisterType<DeclarativeScatterSeries, 5>(uri, versionMajor: 2, versionMinor: 1, qmlName: "ScatterSeries" ); |
336 | qmlRegisterType<DeclarativeLineSeries, 4>(uri, versionMajor: 2, versionMinor: 1, qmlName: "LineSeries" ); |
337 | qmlRegisterType<DeclarativeSplineSeries, 4>(uri, versionMajor: 2, versionMinor: 1, qmlName: "SplineSeries" ); |
338 | |
339 | // QtCharts 2.2 |
340 | qmlRegisterType<DeclarativeCandlestickSeries>(uri, versionMajor: 2, versionMinor: 2, qmlName: "CandlestickSeries" ); |
341 | qmlRegisterType<DeclarativeCandlestickSet>(uri, versionMajor: 2, versionMinor: 2, qmlName: "CandlestickSet" ); |
342 | qmlRegisterUncreatableType<QCandlestickModelMapper>(uri, versionMajor: 2, versionMinor: 2, qmlName: "CandlestickModelMapper" , |
343 | reason: QLatin1String("Trying to create uncreatable: CandlestickModelMapper." )); |
344 | qmlRegisterType<QHCandlestickModelMapper>(uri, versionMajor: 2, versionMinor: 2, qmlName: "HCandlestickModelMapper" ); |
345 | qmlRegisterType<QVCandlestickModelMapper>(uri, versionMajor: 2, versionMinor: 2, qmlName: "VCandlestickModelMapper" ); |
346 | |
347 | // QtCharts 2.3 |
348 | qmlRegisterType<QValueAxis, 1>(uri, versionMajor: 2, versionMinor: 3, qmlName: "ValueAxis" ); |
349 | |
350 | // Auto-increment the import to stay in sync with ALL future QtQuick minor versions |
351 | qmlRegisterModule(uri, versionMajor: 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 | |