##// END OF EJS Templates
Add title to QSeries
Jani Honkonen -
r405:5e158e48d482
parent child
Show More
@@ -1,49 +1,55
1 1 #ifndef QSERIES_H
2 2 #define QSERIES_H
3 3
4 4 #include "qchartglobal.h"
5 5 #include <QObject>
6 6 #include <QAbstractItemModel>
7 7 #include <QPen>
8 8
9 9 QTCOMMERCIALCHART_BEGIN_NAMESPACE
10 10
11 11 class QTCOMMERCIALCHART_EXPORT QSeries : public QObject
12 12 {
13 13 Q_OBJECT
14 14 public:
15 15 enum QSeriesType {
16 16 SeriesTypeLine,
17 17 SeriesTypeArea,
18 18 SeriesTypeBar,
19 19 SeriesTypeStackedBar,
20 20 SeriesTypePercentBar,
21 21 SeriesTypePie,
22 22 SeriesTypeScatter,
23 23 SeriesTypeSpline
24 24 };
25 25
26 26 // Helper class to contain legend and color for it
27 27 // TODO: This as private class? Or should we expose this to user of API
28 28 class Legend {
29 29 public:
30 30 QString mName;
31 31 QPen mPen;
32 32 };
33 33
34 34 protected:
35 35 QSeries(QObject *parent = 0) : QObject(parent) {}
36 36
37 37 public:
38 38 virtual ~QSeries() {}
39 39 virtual QSeriesType type() const = 0;
40 40 // TODO
41 41 virtual bool setModel(QAbstractItemModel* /*model*/) { return false; }
42 42
43 43 // TODO: should this be internal?
44 44 virtual QList<QSeries::Legend> legend() { QList<QSeries::Legend> l; return l; }
45
46 void setTitle(QString title) { m_title = title; }
47 QString title() { return m_title; }
48
49 private:
50 QString m_title;
45 51 };
46 52
47 53 QTCOMMERCIALCHART_END_NAMESPACE
48 54
49 55 #endif
General Comments 0
You need to be logged in to leave comments. Login now