##// END OF EJS Templates
Refactored for MVP...
Refactored for MVP * splits presentation logic and domain model * adds chartpresenter and chartdataset * add signal hadnling to all bar series

File last commit:

r120:c64ea33f6f52
r139:167329998526
Show More
qchartseries.h
50 lines | 1.2 KiB | text/x-c | CLexer
#ifndef QCHARTSERIES_H
#define QCHARTSERIES_H
#include "qchartglobal.h"
#include <QObject>
#include <QAbstractItemModel>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class QTCOMMERCIALCHART_EXPORT QChartSeries : public QObject
{
Q_OBJECT
public:
enum QChartSeriesType {
SeriesTypeInvalid = -1,
SeriesTypeLine,
// SeriesTypeArea,
SeriesTypeBar,
SeriesTypeStackedBar,
SeriesTypePercentBar,
SeriesTypePie,
SeriesTypeScatter
// SeriesTypeSpline
};
protected:
QChartSeries(QObject *parent = 0):QObject(parent){};
public:
virtual ~QChartSeries(){};
// Factory method
static QChartSeries* create(QChartSeriesType type, QObject* parent = 0 );
// Pure virtual
virtual QChartSeriesType type() const = 0;
virtual bool setData(QList<int> /*data*/) { return false; }
virtual bool setData(QList<qreal> /*data*/) { return false; }
virtual bool setData(QList<qreal> /*x*/, QList<qreal> /*y*/){ return false; }
// Prototype for data model. TODO: remove the other setData methods and use something like this for now?
virtual bool setData(QAbstractItemModel* /*model*/) { return false; }
};
QTCOMMERCIALCHART_END_NAMESPACE
#endif