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