plugin.cpp
106 lines
| 5.4 KiB
| text/x-c
|
CppLexer
Jani Honkonen
|
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$ | ||||
** | ||||
****************************************************************************/ | ||||
Jani Honkonen
|
r1 | #include <QtDeclarative/qdeclarativeextensionplugin.h> | ||
#include <QtDeclarative/qdeclarative.h> | ||||
Tero Ahola
|
r836 | #include "qchart.h" | ||
Michal Klocek
|
r1541 | #include "qabstractaxis.h" | ||
Tero Ahola
|
r1139 | #include "qaxiscategories.h" | ||
Jani Honkonen
|
r1 | #include "declarativechart.h" | ||
Tero Ahola
|
r722 | #include "declarativexypoint.h" | ||
Tero Ahola
|
r215 | #include "declarativelineseries.h" | ||
Tero Ahola
|
r732 | #include "declarativesplineseries.h" | ||
Tero Ahola
|
r847 | #include "declarativeareaseries.h" | ||
Tero Ahola
|
r732 | #include "declarativescatterseries.h" | ||
Tero Ahola
|
r646 | #include "declarativebarseries.h" | ||
Tero Ahola
|
r215 | #include "declarativepieseries.h" | ||
Tero Ahola
|
r1278 | #include <QVXYModelMapper> | ||
#include <QHXYModelMapper> | ||||
Tero Ahola
|
r1249 | #include <QHPieModelMapper> | ||
#include <QVPieModelMapper> | ||||
Tero Ahola
|
r1313 | #include <QHBarModelMapper> | ||
#include <QVBarModelMapper> | ||||
Jani Honkonen
|
r1 | |||
Tero Ahola
|
r120 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
Jani Honkonen
|
r1 | |||
Tero Ahola
|
r120 | class ChartQmlPlugin : public QDeclarativeExtensionPlugin | ||
Jani Honkonen
|
r1 | { | ||
Q_OBJECT | ||||
public: | ||||
virtual void registerTypes(const char *uri) | ||||
{ | ||||
Tero Ahola
|
r120 | Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart")); | ||
Tero Ahola
|
r215 | |||
Tero Ahola
|
r1130 | qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView"); | ||
Tero Ahola
|
r1532 | qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint"); | ||
Tero Ahola
|
r196 | qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries"); | ||
Tero Ahola
|
r215 | qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries"); | ||
Tero Ahola
|
r732 | qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries"); | ||
Tero Ahola
|
r847 | qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries"); | ||
Tero Ahola
|
r646 | qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries"); | ||
Tero Ahola
|
r1211 | qmlRegisterType<DeclarativeGroupedBarSeries>(uri, 1, 0, "GroupedBarSeries"); | ||
Tero Ahola
|
r1318 | qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries"); | ||
qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries"); | ||||
Tero Ahola
|
r215 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries"); | ||
Tero Ahola
|
r1329 | qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice"); | ||
Tero Ahola
|
r1240 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet"); | ||
Tero Ahola
|
r1278 | qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper"); | ||
qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper"); | ||||
qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper"); | ||||
qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper"); | ||||
Tero Ahola
|
r1313 | qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper"); | ||
qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper"); | ||||
Tero Ahola
|
r1240 | |||
Tero Ahola
|
r1357 | qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend", | ||
QLatin1String("Trying to create uncreatable: Legend.")); | ||||
Tero Ahola
|
r1491 | qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries", | ||
QLatin1String("Trying to create uncreatable: XYSeries.")); | ||||
Tero Ahola
|
r1276 | qmlRegisterUncreatableType<QScatterSeries>(uri, 1, 0, "QScatterSeries", | ||
QLatin1String("Trying to create uncreatable: QScatterSeries.")); | ||||
Tero Ahola
|
r1265 | qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries", | ||
QLatin1String("Trying to create uncreatable: QPieSeries.")); | ||||
Tero Ahola
|
r1488 | qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "QBarSet", | ||
QLatin1String("Trying to create uncreatable: QBarSet.")); | ||||
Tero Ahola
|
r1249 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel", | ||
QLatin1String("Trying to create uncreatable: AbstractItemModel.")); | ||||
Tero Ahola
|
r1278 | qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper", | ||
QLatin1String("Trying to create uncreatable: XYModelMapper.")); | ||||
Tero Ahola
|
r1249 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper", | ||
QLatin1String("Trying to create uncreatable: PieModelMapper.")); | ||||
Tero Ahola
|
r1313 | qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper", | ||
QLatin1String("Trying to create uncreatable: BarModelMapper.")); | ||||
Tero Ahola
|
r1240 | qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries", | ||
QLatin1String("Trying to create uncreatable: AbstractSeries.")); | ||||
Michal Klocek
|
r1541 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "Axis", | ||
Tero Ahola
|
r1240 | QLatin1String("Trying to create uncreatable: Axis.")); | ||
Tero Ahola
|
r1169 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper", | ||
QLatin1String("Trying to create uncreatable: PieModelMapper.")); | ||||
qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper", | ||||
Tero Ahola
|
r1211 | QLatin1String("Trying to create uncreatable: XYModelMapper.")); | ||
Jani Honkonen
|
r1 | } | ||
}; | ||||
#include "plugin.moc" | ||||
Tero Ahola
|
r120 | QTCOMMERCIALCHART_END_NAMESPACE | ||
QTCOMMERCIALCHART_USE_NAMESPACE | ||||
Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin)) | ||||