plugin.cpp
88 lines
| 4.0 KiB
| text/x-c
|
CppLexer
|
r830 | /**************************************************************************** | ||
** | ||||
** Copyright (C) 2012 Digia Plc | ||||
** All rights reserved. | ||||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial License Agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and Digia. | ||||
** | ||||
** If you have questions regarding the use of this file, please use | ||||
** contact form at http://qt.digia.com | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r1 | #include <QtDeclarative/qdeclarativeextensionplugin.h> | ||
#include <QtDeclarative/qdeclarative.h> | ||||
|
r836 | #include "qchart.h" | ||
|
r1139 | #include "qaxiscategories.h" | ||
|
r1 | #include "declarativechart.h" | ||
|
r722 | #include "declarativexypoint.h" | ||
|
r215 | #include "declarativelineseries.h" | ||
|
r732 | #include "declarativesplineseries.h" | ||
|
r847 | #include "declarativeareaseries.h" | ||
|
r732 | #include "declarativescatterseries.h" | ||
|
r646 | #include "declarativebarseries.h" | ||
|
r215 | #include "declarativepieseries.h" | ||
|
r1169 | #include "declarativemodel.h" | ||
|
r1249 | #include <QHPieModelMapper> | ||
#include <QVPieModelMapper> | ||||
|
r1169 | #include <QXYModelMapper> | ||
|
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 | |||
|
r1130 | qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView"); | ||
|
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"); | ||
|
r847 | qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries"); | ||
|
r646 | qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries"); | ||
|
r1211 | qmlRegisterType<DeclarativeGroupedBarSeries>(uri, 1, 0, "GroupedBarSeries"); | ||
|
r215 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries"); | ||
|
r1259 | qmlRegisterType<DeclarativePieSlice>(uri, 1, 0, "PieSlice"); | ||
|
r1169 | qmlRegisterType<DeclarativeTableModel>(uri, 1, 0, "ChartModel"); | ||
|
r1190 | qmlRegisterType<DeclarativeTableModelElement>(uri, 1, 0, "ChartModelElement"); | ||
|
r1240 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet"); | ||
|
r1265 | qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries", | ||
QLatin1String("Trying to create uncreatable: QPieSeries.")); | ||||
|
r1249 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel", | ||
QLatin1String("Trying to create uncreatable: AbstractItemModel.")); | ||||
qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper", | ||||
QLatin1String("Trying to create uncreatable: PieModelMapper.")); | ||||
qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper"); | ||||
qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper"); | ||||
|
r1240 | |||
qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries", | ||||
QLatin1String("Trying to create uncreatable: AbstractSeries.")); | ||||
qmlRegisterUncreatableType<QAxis>(uri, 1, 0, "Axis", | ||||
QLatin1String("Trying to create uncreatable: Axis.")); | ||||
|
r1169 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper", | ||
QLatin1String("Trying to create uncreatable: PieModelMapper.")); | ||||
qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper", | ||||
|
r1211 | QLatin1String("Trying to create uncreatable: XYModelMapper.")); | ||
|
r1 | } | ||
}; | ||||
#include "plugin.moc" | ||||
|
r120 | QTCOMMERCIALCHART_END_NAMESPACE | ||
QTCOMMERCIALCHART_USE_NAMESPACE | ||||
Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin)) | ||||