qseries.h
54 lines
| 1.2 KiB
| text/x-c
|
CLexer
/ src / qseries.h
|
r360 | #ifndef QSERIES_H | ||
#define QSERIES_H | ||||
|
r23 | |||
|
r30 | #include "qchartglobal.h" | ||
|
r23 | #include <QObject> | ||
|
r71 | #include <QAbstractItemModel> | ||
|
r380 | #include <QPen> | ||
|
r23 | |||
|
r30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r23 | |||
|
r360 | class QTCOMMERCIALCHART_EXPORT QSeries : public QObject | ||
|
r23 | { | ||
|
r71 | Q_OBJECT | ||
|
r23 | public: | ||
|
r360 | enum QSeriesType { | ||
|
r120 | SeriesTypeLine, | ||
|
r309 | SeriesTypeArea, | ||
|
r56 | SeriesTypeBar, | ||
|
r94 | SeriesTypeStackedBar, | ||
|
r101 | SeriesTypePercentBar, | ||
|
r51 | SeriesTypePie, | ||
|
r309 | SeriesTypeScatter, | ||
SeriesTypeSpline | ||||
|
r30 | }; | ||
|
r23 | |||
|
r380 | // Helper class to contain legend and color for it | ||
|
r529 | // TODO: This is actually quite close to current LegendMarker.. combine them? | ||
|
r524 | class LegendEntry { | ||
public: | ||||
|
r380 | QString mName; | ||
|
r529 | QBrush mBrush; | ||
|
r380 | }; | ||
|
r23 | protected: | ||
|
r360 | QSeries(QObject *parent = 0) : QObject(parent) {} | ||
|
r23 | |||
public: | ||||
|
r360 | virtual ~QSeries() {} | ||
virtual QSeriesType type() const = 0; | ||||
|
r309 | // TODO | ||
|
r175 | virtual bool setModel(QAbstractItemModel* /*model*/) { return false; } | ||
|
r380 | |||
|
r524 | virtual QList<QSeries::LegendEntry> legendEntries() { QList<QSeries::LegendEntry> l; return l; } | ||
|
r405 | |||
void setTitle(QString title) { m_title = title; } | ||||
QString title() { return m_title; } | ||||
private: | ||||
QString m_title; | ||||
|
r23 | }; | ||
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
|
r23 | |||
#endif | ||||