##// END OF EJS Templates
Improved QML API test coverage
Improved QML API test coverage

File last commit:

r2117:44f56122f6c5
r2243:9cb45eae013f
Show More
plugin.cpp
189 lines | 10.4 KiB | text/x-c | CppLexer
Jani Honkonen
Add/modify license headers
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$
**
****************************************************************************/
Marek Rosa
Qt5: declarative fix part1...
r2052 #ifdef QT5_QUICK_1
#include <QtQuick1/qdeclarativeextensionplugin.h>
#include <QtQuick1/qdeclarative.h>
#else
#include <QtDeclarative/qdeclarativeextensionplugin.h>
#include <QtDeclarative/qdeclarative.h>
#endif
Tero Ahola
QML api to use chart theme enum of QChart
r836 #include "qchart.h"
Michal Klocek
Refactors QAxis to QAbstractAxis...
r1541 #include "qabstractaxis.h"
Marek Rosa
renamed QValueAxis related files
r1805 #include "qvalueaxis.h"
Tero Ahola
Added CategoryAxis and CategoryRange to QML API
r1870 #include "declarativecategoryaxis.h"
Marek Rosa
renamed QBarCategoryAxis related files
r1810 #include "qbarcategoryaxis.h"
Jani Honkonen
First draft of project structure
r1 #include "declarativechart.h"
Tero Ahola
d
r722 #include "declarativexypoint.h"
Tero Ahola
Dynamic data for QML pie and line series
r215 #include "declarativelineseries.h"
Tero Ahola
Spline to QML API
r732 #include "declarativesplineseries.h"
Tero Ahola
Added area series to QML api
r847 #include "declarativeareaseries.h"
Tero Ahola
Spline to QML API
r732 #include "declarativescatterseries.h"
Tero Ahola
Added QML api for bar series
r646 #include "declarativebarseries.h"
Tero Ahola
Dynamic data for QML pie and line series
r215 #include "declarativepieseries.h"
Marek Rosa
removed many unnecessary includes from declarative files
r1669 #include "qvxymodelmapper.h"
#include "qhxymodelmapper.h"
#include "qhpiemodelmapper.h"
#include "qvpiemodelmapper.h"
#include "qhbarmodelmapper.h"
#include "qvbarmodelmapper.h"
Tero Ahola
Added ChartView.minimumMargins to QML properties
r1928 #include "declarativemargins.h"
Marek Rosa
removed many unnecessary includes from declarative files
r1669 #include <QAbstractItemModel>
Jani Honkonen
First draft of project structure
r1
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 #ifndef QT_ON_ARM
#include "qdatetimeaxis.h"
#endif
Tero Ahola
Fixed a build issue with metatype declaration in decl plugin
r2117 QTCOMMERCIALCHART_USE_NAMESPACE
Tero Ahola
List of slices and barsets as metatypes in decl plugin
r2116 Q_DECLARE_METATYPE(QList<QPieSlice *>)
Q_DECLARE_METATYPE(QList<QBarSet *>)
Jani Honkonen
First draft of project structure
r1
Tero Ahola
Fixed a build issue with metatype declaration in decl plugin
r2117 QTCOMMERCIALCHART_BEGIN_NAMESPACE
Tero Ahola
Proof-of-concept for QML api...
r120 class ChartQmlPlugin : public QDeclarativeExtensionPlugin
Jani Honkonen
First draft of project structure
r1 {
Q_OBJECT
Marek Rosa
Qt5: declarative fix part1...
r2052
#ifdef QT5_QUICK_1
Tero Ahola
Added opacity property to QAbstractSeries
r2067 // TODO: fix the metadata
Marek Rosa
Qt5: declarative fix part1...
r2052 Q_PLUGIN_METADATA(IID "org.qt-project.foo")
#endif
Jani Honkonen
coding style fixes for plugins
r2101 public:
Jani Honkonen
First draft of project structure
r1 virtual void registerTypes(const char *uri)
{
Tero Ahola
Proof-of-concept for QML api...
r120 Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart"));
Tero Ahola
Dynamic data for QML pie and line series
r215
Tero Ahola
List of slices and barsets as metatypes in decl plugin
r2116 qRegisterMetaType<QList<QPieSlice *> >();
qRegisterMetaType<QList<QBarSet *> >();
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 // QtCommercial.Chart 1.0
Tero Ahola
Draft version for QML PieSeries model API
r1130 qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView");
Tero Ahola
Renamed XyPoint to XYPoint
r1532 qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint");
Tero Ahola
Proposal for QML data API
r196 qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries");
Tero Ahola
Dynamic data for QML pie and line series
r215 qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries");
Tero Ahola
Spline to QML API
r732 qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries");
Tero Ahola
Added area series to QML api
r847 qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries");
sauimone
GroupedBarSeries to BarSeries
r1594 qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries");
Tero Ahola
Added stacked and percent bar series to QML api
r1318 qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries");
qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries");
Tero Ahola
Dynamic data for QML pie and line series
r215 qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries");
Tero Ahola
Removed DeclarativePieSlice; properties in QPieSlice now
r1329 qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice");
Tero Ahola
QML demo with dynamic data
r1240 qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet");
Tero Ahola
XY model mappers to QML api
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
Bar model mapper to Qml custom model demo
r1313 qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper");
qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper");
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis");
Marek Rosa
QBarCategoriesAxis renamed to QBarCategoryAxis
r1808 qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis");
Tero Ahola
Qml ChartView properties; legend to use Qt alignments
r1357 qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: Legend."));
Tero Ahola
Documenting xy-series
r1491 qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: XYSeries."));
Tero Ahola
Added new model mappers for pie to QML api
r1249 qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: AbstractItemModel."));
Tero Ahola
XY model mappers to QML api
r1278 qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: XYModelMapper."));
Tero Ahola
Added new model mappers for pie to QML api
r1249 qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: PieModelMapper."));
Tero Ahola
Bar model mapper to Qml custom model demo
r1313 qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: BarModelMapper."));
Tero Ahola
QML demo with dynamic data
r1240 qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: AbstractSeries."));
Michal Klocek
Adds axis to qml...
r1604 qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: AbstractBarSeries."));
Tero Ahola
Added value and category axis to QML api
r1550 qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
Tero Ahola
Fixed QML BarSet::remove
r1908 qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "BarSetBase",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: BarsetBase."));
Tero Ahola
Bugfix: Define pie model mapper outside series scope
r1926 qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead."));
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857
// QtCommercial.Chart 1.1
Tero Ahola
Added ChartView.minimumMargins to QML properties
r1928 qmlRegisterType<DeclarativeChart, 1>(uri, 1, 1, "ChartView");
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 qmlRegisterType<DeclarativeXYPoint>(uri, 1, 1, "XYPoint");
qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries");
qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries");
qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries");
qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries");
qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries");
qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries");
qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries");
qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries");
qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries");
qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries");
qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries");
qmlRegisterType<QPieSlice>(uri, 1, 1, "PieSlice");
qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet");
qmlRegisterType<QHXYModelMapper>(uri, 1, 1, "HXYModelMapper");
qmlRegisterType<QVXYModelMapper>(uri, 1, 1, "VXYModelMapper");
qmlRegisterType<QHPieModelMapper>(uri, 1, 1, "HPieModelMapper");
qmlRegisterType<QVPieModelMapper>(uri, 1, 1, "VPieModelMapper");
qmlRegisterType<QHBarModelMapper>(uri, 1, 1, "HBarModelMapper");
qmlRegisterType<QVBarModelMapper>(uri, 1, 1, "VBarModelMapper");
qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis");
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 #ifndef QT_ON_ARM
Tero Ahola
Added CategoryAxis and CategoryRange to QML API
r1870 qmlRegisterType<QDateTimeAxis>(uri, 1, 1, "DateTimeAxis");
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 #endif
Tero Ahola
Added CategoryAxis and CategoryRange to QML API
r1870 qmlRegisterType<DeclarativeCategoryAxis>(uri, 1, 1, "CategoryAxis");
qmlRegisterType<DeclarativeCategoryRange>(uri, 1, 1, "CategoryRange");
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis");
qmlRegisterUncreatableType<QLegend>(uri, 1, 1, "Legend",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: Legend."));
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 qmlRegisterUncreatableType<QXYSeries>(uri, 1, 1, "XYSeries",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: XYSeries."));
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 1, "AbstractItemModel",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: AbstractItemModel."));
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 1, "XYModelMapper",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: XYModelMapper."));
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 1, "PieModelMapper",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: PieModelMapper."));
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 1, "BarModelMapper",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: BarModelMapper."));
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 1, "AbstractSeries",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: AbstractSeries."));
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 1, "AbstractBarSeries",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: AbstractBarSeries."));
Tero Ahola
QML API versioning to QtCommercial.Chart 1.1
r1857 qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 1, "AbstractAxis",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
Tero Ahola
Fixed QML BarSet::remove
r1908 qmlRegisterUncreatableType<QBarSet>(uri, 1, 1, "BarSetBase",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: BarsetBase."));
Tero Ahola
Bugfix: Define pie model mapper outside series scope
r1926 qmlRegisterUncreatableType<QPieSeries>(uri, 1, 1, "QPieSeries",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead."));
Tero Ahola
Added ChartView.minimumMargins to QML properties
r1928 qmlRegisterUncreatableType<DeclarativeMargins>(uri, 1, 1, "Margins",
Marek Rosa
QDateTimeAxis: qml on arm not registering the type anymore
r1942 QLatin1String("Trying to create uncreatable: Margins."));
Michal Klocek
Rename minimumMargins to margins in QML plugin version 1.2
r2090
// QtCommercial.Chart 1.2
qmlRegisterType<DeclarativeChart, 2>(uri, 1, 2, "ChartView");
Jani Honkonen
First draft of project structure
r1 }
};
#include "plugin.moc"
Tero Ahola
Proof-of-concept for QML api...
r120 QTCOMMERCIALCHART_END_NAMESPACE
QTCOMMERCIALCHART_USE_NAMESPACE
Marek Rosa
Qt5: declarative fix part1...
r2052 #ifndef QT5_QUICK_1
Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin))
#endif