plugin.cpp
38 lines
| 1.3 KiB
| text/x-c
|
CppLexer
/ qmlplugin / plugin.cpp
|
r1 | #include <QtDeclarative/qdeclarativeextensionplugin.h> | ||
#include <QtDeclarative/qdeclarative.h> | ||||
#include "declarativechart.h" | ||||
|
r722 | #include "declarativexypoint.h" | ||
|
r215 | #include "declarativelineseries.h" | ||
|
r732 | #include "declarativesplineseries.h" | ||
#include "declarativescatterseries.h" | ||||
|
r646 | #include "declarativebarseries.h" | ||
|
r215 | #include "declarativepieseries.h" | ||
|
r1 | |||
|
r120 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r1 | |||
|
r120 | class ChartQmlPlugin : public QDeclarativeExtensionPlugin | ||
|
r1 | { | ||
Q_OBJECT | ||||
public: | ||||
virtual void registerTypes(const char *uri) | ||||
{ | ||||
|
r120 | Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart")); | ||
|
r215 | |||
|
r1 | qmlRegisterType<DeclarativeChart>(uri, 1, 0, "Chart"); | ||
|
r722 | qmlRegisterType<DeclarativeXyPoint>(uri, 1, 0, "XyPoint"); | ||
|
r196 | qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries"); | ||
|
r215 | qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries"); | ||
|
r732 | qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries"); | ||
|
r646 | qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries"); | ||
|
r215 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries"); | ||
|
r722 | qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice"); | ||
|
r1 | } | ||
}; | ||||
#include "plugin.moc" | ||||
|
r120 | QTCOMMERCIALCHART_END_NAMESPACE | ||
QTCOMMERCIALCHART_USE_NAMESPACE | ||||
Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin)) | ||||