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