qchartseries.h
50 lines
| 1.3 KiB
| text/x-c
|
CLexer
/ src / qchartseries.h
|
r23 | #ifndef QCHARTSERIES_H | ||
#define QCHARTSERIES_H | ||||
|
r30 | #include "qchartglobal.h" | ||
|
r23 | #include <QObject> | ||
|
r71 | #include <QAbstractItemModel> | ||
|
r23 | |||
|
r30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r23 | |||
|
r30 | class QTCOMMERCIALCHART_EXPORT QChartSeries : public QObject | ||
|
r23 | { | ||
|
r71 | Q_OBJECT | ||
|
r23 | public: | ||
|
r30 | enum QChartSeriesType { | ||
|
r120 | SeriesTypeInvalid = -1, | ||
SeriesTypeLine, | ||||
|
r30 | // SeriesTypeArea, | ||
|
r56 | SeriesTypeBar, | ||
|
r94 | SeriesTypeStackedBar, | ||
|
r101 | SeriesTypePercentBar, | ||
|
r51 | SeriesTypePie, | ||
|
r30 | SeriesTypeScatter | ||
// SeriesTypeSpline | ||||
}; | ||||
|
r23 | |||
protected: | ||||
|
r39 | QChartSeries(QObject *parent = 0):QObject(parent){}; | ||
|
r23 | |||
public: | ||||
|
r39 | virtual ~QChartSeries(){}; | ||
|
r23 | |||
|
r61 | // Pure virtual | ||
|
r23 | virtual QChartSeriesType type() const = 0; | ||
|
r39 | |||
|
r110 | 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; } | ||||
|
r71 | |||
// Prototype for data model. TODO: remove the other setData methods and use something like this for now? | ||||
|
r110 | virtual bool setData(QAbstractItemModel* /*model*/) { return false; } | ||
|
r71 | |||
|
r164 | // Methods for building a table for bar chart. Call repeatedly to add more than one series | ||
virtual int addData(QList<qreal> data) {return -1;} | ||||
virtual void removeData(int id) {} | ||||
|
r23 | }; | ||
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
|
r23 | |||
#endif | ||||