##// END OF EJS Templates
Refactored series creation.
Refactored series creation.

File last commit:

r62:d89198258a93
r62:d89198258a93
Show More
qchartseries.cpp
32 lines | 777 B | text/x-c | CppLexer
/ src / qchartseries.cpp
sauimone
Refactored series creation.
r62 #include "qchartglobal.h"
#include "qchartseries.h"
#include "barchartseries.h"
#include "qxychartseries.h"
QTCOMMERCIALCHART_BEGIN_NAMESPACE
QChartSeries* QChartSeries::create(QChartSeriesType type, QObject* parent)
{
// TODO: Other types
switch (type) {
case QChartSeries::SeriesTypeLine: {
QXYChartSeries* s = QXYChartSeries::create(parent); // TODO: do we need create method for derived implementations?
return s;
}
case QChartSeries::SeriesTypePie: {
return 0;
}
case QChartSeries::SeriesTypeScatter: {
return 0;
}
case QChartSeries::SeriesTypeBar: {
BarChartSeries* s = new BarChartSeries(parent);
return s;
}
default:
return 0;
}
}
QTCOMMERCIALCHART_END_NAMESPACE