@@ -1,85 +1,86 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef QABSTRACTSERIES_H |
|
21 | #ifndef QABSTRACTSERIES_H | |
22 | #define QABSTRACTSERIES_H |
|
22 | #define QABSTRACTSERIES_H | |
23 |
|
23 | |||
24 | #include <qchartglobal.h> |
|
24 | #include <qchartglobal.h> | |
25 | #include <qabstractaxis.h> |
|
25 | #include <qabstractaxis.h> | |
26 | #include <QObject> |
|
26 | #include <QObject> | |
27 | #include <QPen> |
|
27 | #include <QPen> | |
28 |
|
28 | |||
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
30 |
|
30 | |||
31 | class QAbstractSeriesPrivate; |
|
31 | class QAbstractSeriesPrivate; | |
32 | class QChart; |
|
32 | class QChart; | |
33 |
|
33 | |||
34 | class QTCOMMERCIALCHART_EXPORT QAbstractSeries : public QObject |
|
34 | class QTCOMMERCIALCHART_EXPORT QAbstractSeries : public QObject | |
35 | { |
|
35 | { | |
36 | Q_OBJECT |
|
36 | Q_OBJECT | |
37 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) |
|
37 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) | |
38 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) |
|
38 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) | |
39 | Q_PROPERTY(SeriesType type READ type) |
|
39 | Q_PROPERTY(SeriesType type READ type) | |
40 | Q_ENUMS(SeriesType) |
|
40 | Q_ENUMS(SeriesType) | |
41 |
|
41 | |||
42 | public: |
|
42 | public: | |
43 | enum SeriesType { |
|
43 | enum SeriesType { | |
44 | SeriesTypeLine, |
|
44 | SeriesTypeLine, | |
45 | SeriesTypeArea, |
|
45 | SeriesTypeArea, | |
46 | SeriesTypeBar, |
|
46 | SeriesTypeBar, | |
47 | SeriesTypeStackedBar, |
|
47 | SeriesTypeStackedBar, | |
48 | SeriesTypePercentBar, |
|
48 | SeriesTypePercentBar, | |
49 | SeriesTypePie, |
|
49 | SeriesTypePie, | |
50 | SeriesTypeScatter, |
|
50 | SeriesTypeScatter, | |
51 | SeriesTypeSpline, |
|
51 | SeriesTypeSpline, | |
52 | SeriesTypeHorizontalBar |
|
52 | SeriesTypeHorizontalBar | |
53 |
|
53 | SeriesTypeHorizontalStackedBar, | ||
|
54 | SeriesTypeHorizontalPercentBar | |||
54 | }; |
|
55 | }; | |
55 |
|
56 | |||
56 | protected: |
|
57 | protected: | |
57 | QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0); |
|
58 | QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0); | |
58 |
|
59 | |||
59 | public: |
|
60 | public: | |
60 | ~QAbstractSeries(); |
|
61 | ~QAbstractSeries(); | |
61 | virtual SeriesType type() const = 0; |
|
62 | virtual SeriesType type() const = 0; | |
62 |
|
63 | |||
63 | void setName(const QString& name); |
|
64 | void setName(const QString& name); | |
64 | QString name() const; |
|
65 | QString name() const; | |
65 | void setVisible(bool visible = true); |
|
66 | void setVisible(bool visible = true); | |
66 | bool isVisible() const; |
|
67 | bool isVisible() const; | |
67 | QChart* chart() const; |
|
68 | QChart* chart() const; | |
68 |
|
69 | |||
69 | void show(); |
|
70 | void show(); | |
70 | void hide(); |
|
71 | void hide(); | |
71 |
|
72 | |||
72 | Q_SIGNALS: |
|
73 | Q_SIGNALS: | |
73 | void nameChanged(); |
|
74 | void nameChanged(); | |
74 | void visibleChanged(); |
|
75 | void visibleChanged(); | |
75 |
|
76 | |||
76 | protected: |
|
77 | protected: | |
77 | QScopedPointer<QAbstractSeriesPrivate> d_ptr; |
|
78 | QScopedPointer<QAbstractSeriesPrivate> d_ptr; | |
78 | friend class ChartDataSet; |
|
79 | friend class ChartDataSet; | |
79 | friend class ChartPresenter; |
|
80 | friend class ChartPresenter; | |
80 | friend class QLegendPrivate; |
|
81 | friend class QLegendPrivate; | |
81 | }; |
|
82 | }; | |
82 |
|
83 | |||
83 | QTCOMMERCIALCHART_END_NAMESPACE |
|
84 | QTCOMMERCIALCHART_END_NAMESPACE | |
84 |
|
85 | |||
85 | #endif |
|
86 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now