plugin.cpp
59 lines
| 2.1 KiB
| text/x-c
|
CppLexer
/ qmlplugin / plugin.cpp
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" | ||
Jani Honkonen
|
r1 | #include "declarativechart.h" | ||
Tero Ahola
|
r722 | #include "declarativexypoint.h" | ||
Tero Ahola
|
r215 | #include "declarativelineseries.h" | ||
Tero Ahola
|
r732 | #include "declarativesplineseries.h" | ||
#include "declarativescatterseries.h" | ||||
Tero Ahola
|
r646 | #include "declarativebarseries.h" | ||
Tero Ahola
|
r215 | #include "declarativepieseries.h" | ||
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 | |||
Jani Honkonen
|
r1 | qmlRegisterType<DeclarativeChart>(uri, 1, 0, "Chart"); | ||
Tero Ahola
|
r722 | 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
|
r646 | qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries"); | ||
Tero Ahola
|
r215 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries"); | ||
Tero Ahola
|
r722 | qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice"); | ||
Jani Honkonen
|
r1 | } | ||
}; | ||||
#include "plugin.moc" | ||||
Tero Ahola
|
r120 | QTCOMMERCIALCHART_END_NAMESPACE | ||
QTCOMMERCIALCHART_USE_NAMESPACE | ||||
Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin)) | ||||