##// END OF EJS Templates
Fixed bug in setting chart theme...
Fixed bug in setting chart theme The bug was that if you first add a series, then change theme and then restore the original theme, the color of the series was changed even though it should have been restored to match the original color.

File last commit:

r311:e1f0c8c24a70
r312:0677c9dd6d92
Show More
plugin.cpp
35 lines | 1.2 KiB | text/x-c | CppLexer
Jani Honkonen
First draft of project structure
r1 #include <QtDeclarative/qdeclarativeextensionplugin.h>
#include <QtDeclarative/qdeclarative.h>
#include "declarativechart.h"
Tero Ahola
Proposal for QML data API
r196 #include "scatterelement.h"
#include "declarativescatterseries.h"
Tero Ahola
Dynamic data for QML pie and line series
r215 #include "declarativelineseries.h"
#include "declarativepieseries.h"
Jani Honkonen
First draft of project structure
r1
Tero Ahola
Proof-of-concept for QML api...
r120 QTCOMMERCIALCHART_BEGIN_NAMESPACE
Jani Honkonen
First draft of project structure
r1
Tero Ahola
Proof-of-concept for QML api...
r120 class ChartQmlPlugin : public QDeclarativeExtensionPlugin
Jani Honkonen
First draft of project structure
r1 {
Q_OBJECT
public:
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
Jani Honkonen
First draft of project structure
r1 qmlRegisterType<DeclarativeChart>(uri, 1, 0, "Chart");
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");
qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries");
qmlRegisterType<QPieSlice>(uri, 1, 0, "ChartPieElement");
// TODO: rename ScatterElement class to something like "PointElement"
qmlRegisterType<ScatterElement>(uri, 1, 0, "ChartPointElement");
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
Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin))