@@ -1,213 +1,215 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt 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 Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "qchart.h" |
|
21 | #include "qchart.h" | |
22 | #include "qabstractaxis.h" |
|
22 | #include "qabstractaxis.h" | |
23 | #include "qvalueaxis.h" |
|
23 | #include "qvalueaxis.h" | |
24 | #include "declarativecategoryaxis.h" |
|
24 | #include "declarativecategoryaxis.h" | |
25 | #include "qbarcategoryaxis.h" |
|
25 | #include "qbarcategoryaxis.h" | |
26 | #include "declarativechart.h" |
|
26 | #include "declarativechart.h" | |
27 | #include "declarativexypoint.h" |
|
27 | #include "declarativexypoint.h" | |
28 | #include "declarativelineseries.h" |
|
28 | #include "declarativelineseries.h" | |
29 | #include "declarativesplineseries.h" |
|
29 | #include "declarativesplineseries.h" | |
30 | #include "declarativeareaseries.h" |
|
30 | #include "declarativeareaseries.h" | |
31 | #include "declarativescatterseries.h" |
|
31 | #include "declarativescatterseries.h" | |
32 | #include "declarativebarseries.h" |
|
32 | #include "declarativebarseries.h" | |
33 | #include "declarativepieseries.h" |
|
33 | #include "declarativepieseries.h" | |
34 | #include "qvxymodelmapper.h" |
|
34 | #include "qvxymodelmapper.h" | |
35 | #include "qhxymodelmapper.h" |
|
35 | #include "qhxymodelmapper.h" | |
36 | #include "qhpiemodelmapper.h" |
|
36 | #include "qhpiemodelmapper.h" | |
37 | #include "qvpiemodelmapper.h" |
|
37 | #include "qvpiemodelmapper.h" | |
38 | #include "qhbarmodelmapper.h" |
|
38 | #include "qhbarmodelmapper.h" | |
39 | #include "qvbarmodelmapper.h" |
|
39 | #include "qvbarmodelmapper.h" | |
40 | #include "declarativemargins.h" |
|
40 | #include "declarativemargins.h" | |
41 | #include "qarealegendmarker.h" |
|
41 | #include "qarealegendmarker.h" | |
42 | #include "qbarlegendmarker.h" |
|
42 | #include "qbarlegendmarker.h" | |
43 | #include "qpielegendmarker.h" |
|
43 | #include "qpielegendmarker.h" | |
44 | #include "qxylegendmarker.h" |
|
44 | #include "qxylegendmarker.h" | |
45 | #ifndef QT_ON_ARM |
|
45 | #ifndef QT_ON_ARM | |
46 | #include "qdatetimeaxis.h" |
|
46 | #include "qdatetimeaxis.h" | |
47 | #endif |
|
47 | #endif | |
48 | #include <QAbstractItemModel> |
|
48 | #include <QAbstractItemModel> | |
49 | #include <QtDeclarative/qdeclarativeextensionplugin.h> |
|
49 | #include <QtDeclarative/qdeclarativeextensionplugin.h> | |
50 | #include <QtDeclarative/qdeclarative.h> |
|
50 | #include <QtDeclarative/qdeclarative.h> | |
51 |
|
51 | |||
52 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
52 | QTCOMMERCIALCHART_USE_NAMESPACE | |
53 |
|
53 | |||
54 | Q_DECLARE_METATYPE(QList<QPieSlice *>) |
|
54 | Q_DECLARE_METATYPE(QList<QPieSlice *>) | |
55 | Q_DECLARE_METATYPE(QList<QBarSet *>) |
|
55 | Q_DECLARE_METATYPE(QList<QBarSet *>) | |
56 |
|
56 | |||
57 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) |
|
57 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | |
58 |
|
58 | |||
59 | // NOTE: Hackish fixes for Qt5 (beta2). |
|
59 | // NOTE: Hackish fixes for Qt5 (beta2). | |
60 | // These should not be needed or at least they are not needed in Qt4. |
|
60 | // These should not be needed or at least they are not needed in Qt4. | |
61 |
|
61 | |||
62 | Q_DECLARE_METATYPE(DeclarativeChart::SeriesType) |
|
62 | Q_DECLARE_METATYPE(DeclarativeChart::SeriesType) | |
63 | Q_DECLARE_METATYPE(DeclarativeMargins *) |
|
63 | Q_DECLARE_METATYPE(DeclarativeMargins *) | |
64 | Q_DECLARE_METATYPE(DeclarativeAreaSeries *) |
|
64 | Q_DECLARE_METATYPE(DeclarativeAreaSeries *) | |
65 | Q_DECLARE_METATYPE(DeclarativeBarSeries *) |
|
65 | Q_DECLARE_METATYPE(DeclarativeBarSeries *) | |
66 | Q_DECLARE_METATYPE(DeclarativeLineSeries *) |
|
66 | Q_DECLARE_METATYPE(DeclarativeLineSeries *) | |
67 | Q_DECLARE_METATYPE(DeclarativePieSeries *) |
|
67 | Q_DECLARE_METATYPE(DeclarativePieSeries *) | |
68 | Q_DECLARE_METATYPE(DeclarativeScatterSeries *) |
|
68 | Q_DECLARE_METATYPE(DeclarativeScatterSeries *) | |
69 | Q_DECLARE_METATYPE(DeclarativeSplineSeries *) |
|
69 | Q_DECLARE_METATYPE(DeclarativeSplineSeries *) | |
70 |
|
70 | |||
71 | Q_DECLARE_METATYPE(QAbstractAxis *) |
|
71 | Q_DECLARE_METATYPE(QAbstractAxis *) | |
72 | Q_DECLARE_METATYPE(QValueAxis *) |
|
72 | Q_DECLARE_METATYPE(QValueAxis *) | |
73 | Q_DECLARE_METATYPE(QBarCategoryAxis *) |
|
73 | Q_DECLARE_METATYPE(QBarCategoryAxis *) | |
74 | Q_DECLARE_METATYPE(QCategoryAxis *) |
|
74 | Q_DECLARE_METATYPE(QCategoryAxis *) | |
75 | Q_DECLARE_METATYPE(QDateTimeAxis *) |
|
75 | Q_DECLARE_METATYPE(QDateTimeAxis *) | |
76 |
|
76 | |||
77 | Q_DECLARE_METATYPE(QLegend *) |
|
77 | Q_DECLARE_METATYPE(QLegend *) | |
78 | Q_DECLARE_METATYPE(QLegendMarker *) |
|
78 | Q_DECLARE_METATYPE(QLegendMarker *) | |
79 | Q_DECLARE_METATYPE(QAreaLegendMarker *) |
|
79 | Q_DECLARE_METATYPE(QAreaLegendMarker *) | |
80 | Q_DECLARE_METATYPE(QBarLegendMarker *) |
|
80 | Q_DECLARE_METATYPE(QBarLegendMarker *) | |
81 | Q_DECLARE_METATYPE(QPieLegendMarker *) |
|
81 | Q_DECLARE_METATYPE(QPieLegendMarker *) | |
82 |
|
82 | |||
83 | Q_DECLARE_METATYPE(QHPieModelMapper *) |
|
83 | Q_DECLARE_METATYPE(QHPieModelMapper *) | |
84 | Q_DECLARE_METATYPE(QHXYModelMapper *) |
|
84 | Q_DECLARE_METATYPE(QHXYModelMapper *) | |
85 | Q_DECLARE_METATYPE(QPieModelMapper *) |
|
85 | Q_DECLARE_METATYPE(QPieModelMapper *) | |
86 | Q_DECLARE_METATYPE(QHBarModelMapper *) |
|
86 | Q_DECLARE_METATYPE(QHBarModelMapper *) | |
87 | Q_DECLARE_METATYPE(QBarModelMapper *) |
|
87 | Q_DECLARE_METATYPE(QBarModelMapper *) | |
88 | Q_DECLARE_METATYPE(QVBarModelMapper *) |
|
88 | Q_DECLARE_METATYPE(QVBarModelMapper *) | |
89 | Q_DECLARE_METATYPE(QVPieModelMapper *) |
|
89 | Q_DECLARE_METATYPE(QVPieModelMapper *) | |
90 | Q_DECLARE_METATYPE(QVXYModelMapper *) |
|
90 | Q_DECLARE_METATYPE(QVXYModelMapper *) | |
91 | Q_DECLARE_METATYPE(QXYLegendMarker *) |
|
91 | Q_DECLARE_METATYPE(QXYLegendMarker *) | |
92 | Q_DECLARE_METATYPE(QXYModelMapper *) |
|
92 | Q_DECLARE_METATYPE(QXYModelMapper *) | |
93 |
|
93 | |||
94 | Q_DECLARE_METATYPE(QAbstractSeries *) |
|
94 | Q_DECLARE_METATYPE(QAbstractSeries *) | |
95 | Q_DECLARE_METATYPE(QXYSeries *) |
|
95 | Q_DECLARE_METATYPE(QXYSeries *) | |
96 | Q_DECLARE_METATYPE(QAbstractBarSeries *) |
|
96 | Q_DECLARE_METATYPE(QAbstractBarSeries *) | |
97 | Q_DECLARE_METATYPE(QBarSeries *) |
|
97 | Q_DECLARE_METATYPE(QBarSeries *) | |
98 | Q_DECLARE_METATYPE(QBarSet *) |
|
98 | Q_DECLARE_METATYPE(QBarSet *) | |
99 | Q_DECLARE_METATYPE(QAreaSeries *) |
|
99 | Q_DECLARE_METATYPE(QAreaSeries *) | |
100 | Q_DECLARE_METATYPE(QHorizontalBarSeries *) |
|
100 | Q_DECLARE_METATYPE(QHorizontalBarSeries *) | |
101 | Q_DECLARE_METATYPE(QHorizontalPercentBarSeries *) |
|
101 | Q_DECLARE_METATYPE(QHorizontalPercentBarSeries *) | |
102 | Q_DECLARE_METATYPE(QHorizontalStackedBarSeries *) |
|
102 | Q_DECLARE_METATYPE(QHorizontalStackedBarSeries *) | |
103 | Q_DECLARE_METATYPE(QLineSeries *) |
|
103 | Q_DECLARE_METATYPE(QLineSeries *) | |
104 | Q_DECLARE_METATYPE(QPercentBarSeries *) |
|
104 | Q_DECLARE_METATYPE(QPercentBarSeries *) | |
105 | Q_DECLARE_METATYPE(QPieSeries *) |
|
105 | Q_DECLARE_METATYPE(QPieSeries *) | |
106 | Q_DECLARE_METATYPE(QPieSlice *) |
|
106 | Q_DECLARE_METATYPE(QPieSlice *) | |
107 | Q_DECLARE_METATYPE(QScatterSeries *) |
|
107 | Q_DECLARE_METATYPE(QScatterSeries *) | |
108 | Q_DECLARE_METATYPE(QSplineSeries *) |
|
108 | Q_DECLARE_METATYPE(QSplineSeries *) | |
109 | Q_DECLARE_METATYPE(QStackedBarSeries *) |
|
109 | Q_DECLARE_METATYPE(QStackedBarSeries *) | |
110 |
|
110 | |||
111 | #endif |
|
111 | #endif | |
112 |
|
112 | |||
113 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
113 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
114 |
|
114 | |||
115 | class ChartQmlPlugin : public QDeclarativeExtensionPlugin |
|
115 | class ChartQmlPlugin : public QDeclarativeExtensionPlugin | |
116 | { |
|
116 | { | |
117 | Q_OBJECT |
|
117 | Q_OBJECT | |
118 |
|
118 | |||
119 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) |
|
119 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | |
120 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface") |
|
120 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface") | |
121 | #endif |
|
121 | #endif | |
122 |
|
122 | |||
123 | public: |
|
123 | public: | |
124 | virtual void registerTypes(const char *uri) |
|
124 | virtual void registerTypes(const char *uri) | |
125 | { |
|
125 | { | |
126 | Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart")); |
|
126 | Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart")); | |
127 |
|
127 | |||
128 | qRegisterMetaType<QList<QPieSlice *> >(); |
|
128 | qRegisterMetaType<QList<QPieSlice *> >(); | |
129 | qRegisterMetaType<QList<QBarSet *> >(); |
|
129 | qRegisterMetaType<QList<QBarSet *> >(); | |
|
130 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | |||
130 | qRegisterMetaType<DeclarativeChart::SeriesType>(); |
|
131 | qRegisterMetaType<DeclarativeChart::SeriesType>(); | |
|
132 | #endif | |||
131 |
|
133 | |||
132 | // QtCommercial.Chart 1.0 |
|
134 | // QtCommercial.Chart 1.0 | |
133 | qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView"); |
|
135 | qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView"); | |
134 | qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint"); |
|
136 | qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint"); | |
135 | qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries"); |
|
137 | qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries"); | |
136 | qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries"); |
|
138 | qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries"); | |
137 | qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries"); |
|
139 | qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries"); | |
138 | qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries"); |
|
140 | qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries"); | |
139 | qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries"); |
|
141 | qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries"); | |
140 | qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries"); |
|
142 | qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries"); | |
141 | qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries"); |
|
143 | qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries"); | |
142 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries"); |
|
144 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries"); | |
143 | qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice"); |
|
145 | qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice"); | |
144 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet"); |
|
146 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet"); | |
145 | qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper"); |
|
147 | qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper"); | |
146 | qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper"); |
|
148 | qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper"); | |
147 | qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper"); |
|
149 | qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper"); | |
148 | qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper"); |
|
150 | qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper"); | |
149 | qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper"); |
|
151 | qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper"); | |
150 | qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper"); |
|
152 | qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper"); | |
151 | qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis"); |
|
153 | qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis"); | |
152 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis"); |
|
154 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis"); | |
153 | qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend", |
|
155 | qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend", | |
154 | QLatin1String("Trying to create uncreatable: Legend.")); |
|
156 | QLatin1String("Trying to create uncreatable: Legend.")); | |
155 | qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries", |
|
157 | qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries", | |
156 | QLatin1String("Trying to create uncreatable: XYSeries.")); |
|
158 | QLatin1String("Trying to create uncreatable: XYSeries.")); | |
157 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel", |
|
159 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel", | |
158 | QLatin1String("Trying to create uncreatable: AbstractItemModel.")); |
|
160 | QLatin1String("Trying to create uncreatable: AbstractItemModel.")); | |
159 | qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper", |
|
161 | qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper", | |
160 | QLatin1String("Trying to create uncreatable: XYModelMapper.")); |
|
162 | QLatin1String("Trying to create uncreatable: XYModelMapper.")); | |
161 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper", |
|
163 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper", | |
162 | QLatin1String("Trying to create uncreatable: PieModelMapper.")); |
|
164 | QLatin1String("Trying to create uncreatable: PieModelMapper.")); | |
163 | qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper", |
|
165 | qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper", | |
164 | QLatin1String("Trying to create uncreatable: BarModelMapper.")); |
|
166 | QLatin1String("Trying to create uncreatable: BarModelMapper.")); | |
165 | qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries", |
|
167 | qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries", | |
166 | QLatin1String("Trying to create uncreatable: AbstractSeries.")); |
|
168 | QLatin1String("Trying to create uncreatable: AbstractSeries.")); | |
167 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries", |
|
169 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries", | |
168 | QLatin1String("Trying to create uncreatable: AbstractBarSeries.")); |
|
170 | QLatin1String("Trying to create uncreatable: AbstractBarSeries.")); | |
169 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis", |
|
171 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis", | |
170 | QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead.")); |
|
172 | QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead.")); | |
171 | qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "BarSetBase", |
|
173 | qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "BarSetBase", | |
172 | QLatin1String("Trying to create uncreatable: BarsetBase.")); |
|
174 | QLatin1String("Trying to create uncreatable: BarsetBase.")); | |
173 | qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries", |
|
175 | qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries", | |
174 | QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead.")); |
|
176 | QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead.")); | |
175 |
|
177 | |||
176 | // QtCommercial.Chart 1.1 |
|
178 | // QtCommercial.Chart 1.1 | |
177 | qmlRegisterType<DeclarativeChart, 1>(uri, 1, 1, "ChartView"); |
|
179 | qmlRegisterType<DeclarativeChart, 1>(uri, 1, 1, "ChartView"); | |
178 | qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries"); |
|
180 | qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries"); | |
179 | qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries"); |
|
181 | qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries"); | |
180 | qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries"); |
|
182 | qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries"); | |
181 | qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries"); |
|
183 | qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries"); | |
182 | qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries"); |
|
184 | qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries"); | |
183 | qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries"); |
|
185 | qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries"); | |
184 | qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries"); |
|
186 | qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries"); | |
185 | qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries"); |
|
187 | qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries"); | |
186 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries"); |
|
188 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries"); | |
187 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries"); |
|
189 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries"); | |
188 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries"); |
|
190 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries"); | |
189 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet"); |
|
191 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet"); | |
190 | qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis"); |
|
192 | qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis"); | |
191 | #ifndef QT_ON_ARM |
|
193 | #ifndef QT_ON_ARM | |
192 | qmlRegisterType<QDateTimeAxis>(uri, 1, 1, "DateTimeAxis"); |
|
194 | qmlRegisterType<QDateTimeAxis>(uri, 1, 1, "DateTimeAxis"); | |
193 | #endif |
|
195 | #endif | |
194 | qmlRegisterType<DeclarativeCategoryAxis>(uri, 1, 1, "CategoryAxis"); |
|
196 | qmlRegisterType<DeclarativeCategoryAxis>(uri, 1, 1, "CategoryAxis"); | |
195 | qmlRegisterType<DeclarativeCategoryRange>(uri, 1, 1, "CategoryRange"); |
|
197 | qmlRegisterType<DeclarativeCategoryRange>(uri, 1, 1, "CategoryRange"); | |
196 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis"); |
|
198 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis"); | |
197 | qmlRegisterUncreatableType<DeclarativeMargins>(uri, 1, 1, "Margins", |
|
199 | qmlRegisterUncreatableType<DeclarativeMargins>(uri, 1, 1, "Margins", | |
198 | QLatin1String("Trying to create uncreatable: Margins.")); |
|
200 | QLatin1String("Trying to create uncreatable: Margins.")); | |
199 |
|
201 | |||
200 | // QtCommercial.Chart 1.2 |
|
202 | // QtCommercial.Chart 1.2 | |
201 | qmlRegisterType<DeclarativeChart, 2>(uri, 1, 2, "ChartView"); |
|
203 | qmlRegisterType<DeclarativeChart, 2>(uri, 1, 2, "ChartView"); | |
202 | } |
|
204 | } | |
203 | }; |
|
205 | }; | |
204 |
|
206 | |||
205 | #include "plugin.moc" |
|
207 | #include "plugin.moc" | |
206 |
|
208 | |||
207 | QTCOMMERCIALCHART_END_NAMESPACE |
|
209 | QTCOMMERCIALCHART_END_NAMESPACE | |
208 |
|
210 | |||
209 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
211 | QTCOMMERCIALCHART_USE_NAMESPACE | |
210 |
|
212 | |||
211 | #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) |
|
213 | #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) | |
212 | Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin)) |
|
214 | Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin)) | |
213 | #endif |
|
215 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now