##// END OF EJS Templates
Fixed BarSeries::onClicked on QML API
Tero Ahola -
r1488:f67fcad3d13b
parent child
Show More
@@ -1,103 +1,105
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #include <QtDeclarative/qdeclarativeextensionplugin.h>
22 22 #include <QtDeclarative/qdeclarative.h>
23 23 #include "qchart.h"
24 24 #include "qaxiscategories.h"
25 25 #include "declarativechart.h"
26 26 #include "declarativexypoint.h"
27 27 #include "declarativelineseries.h"
28 28 #include "declarativesplineseries.h"
29 29 #include "declarativeareaseries.h"
30 30 #include "declarativescatterseries.h"
31 31 #include "declarativebarseries.h"
32 32 #include "declarativepieseries.h"
33 33 #include <QVXYModelMapper>
34 34 #include <QHXYModelMapper>
35 35 #include <QHPieModelMapper>
36 36 #include <QVPieModelMapper>
37 37 #include <QHBarModelMapper>
38 38 #include <QVBarModelMapper>
39 39
40 40 QTCOMMERCIALCHART_BEGIN_NAMESPACE
41 41
42 42 class ChartQmlPlugin : public QDeclarativeExtensionPlugin
43 43 {
44 44 Q_OBJECT
45 45 public:
46 46 virtual void registerTypes(const char *uri)
47 47 {
48 48 Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart"));
49 49
50 50 qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView");
51 51 qmlRegisterType<DeclarativeXyPoint>(uri, 1, 0, "XyPoint");
52 52 qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries");
53 53 qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries");
54 54 qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries");
55 55 qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries");
56 56 qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries");
57 57 qmlRegisterType<DeclarativeGroupedBarSeries>(uri, 1, 0, "GroupedBarSeries");
58 58 qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries");
59 59 qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries");
60 60 qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries");
61 61 qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice");
62 62 qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet");
63 63 qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper");
64 64 qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper");
65 65 qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper");
66 66 qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper");
67 67 qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper");
68 68 qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper");
69 69
70 70 qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend",
71 71 QLatin1String("Trying to create uncreatable: Legend."));
72 72 qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "QXYSeries",
73 73 QLatin1String("Trying to create uncreatable: QXYSeries."));
74 74 qmlRegisterUncreatableType<QScatterSeries>(uri, 1, 0, "QScatterSeries",
75 75 QLatin1String("Trying to create uncreatable: QScatterSeries."));
76 76 qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries",
77 77 QLatin1String("Trying to create uncreatable: QPieSeries."));
78 qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "QBarSet",
79 QLatin1String("Trying to create uncreatable: QBarSet."));
78 80 qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel",
79 81 QLatin1String("Trying to create uncreatable: AbstractItemModel."));
80 82 qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper",
81 83 QLatin1String("Trying to create uncreatable: XYModelMapper."));
82 84 qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper",
83 85 QLatin1String("Trying to create uncreatable: PieModelMapper."));
84 86 qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper",
85 87 QLatin1String("Trying to create uncreatable: BarModelMapper."));
86 88 qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries",
87 89 QLatin1String("Trying to create uncreatable: AbstractSeries."));
88 90 qmlRegisterUncreatableType<QAxis>(uri, 1, 0, "Axis",
89 91 QLatin1String("Trying to create uncreatable: Axis."));
90 92 qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper",
91 93 QLatin1String("Trying to create uncreatable: PieModelMapper."));
92 94 qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper",
93 95 QLatin1String("Trying to create uncreatable: XYModelMapper."));
94 96 }
95 97 };
96 98
97 99 #include "plugin.moc"
98 100
99 101 QTCOMMERCIALCHART_END_NAMESPACE
100 102
101 103 QTCOMMERCIALCHART_USE_NAMESPACE
102 104
103 105 Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin))
General Comments 0
You need to be logged in to leave comments. Login now