@@ -1,104 +1,105 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 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 QLEGENDMARKER_H |
|
21 | #ifndef QLEGENDMARKER_H | |
22 | #define QLEGENDMARKER_H |
|
22 | #define QLEGENDMARKER_H | |
23 |
|
23 | |||
24 | #include <QChartGlobal> |
|
24 | #include <QChartGlobal> | |
25 | #include <QObject> |
|
25 | #include <QObject> | |
26 | #include <QPen> |
|
26 | #include <QPen> | |
27 | #include <QBrush> |
|
27 | #include <QBrush> | |
28 | #include <QFont> |
|
28 | #include <QFont> | |
29 |
|
29 | |||
30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
31 |
|
31 | |||
32 | class QLegendMarkerPrivate; |
|
32 | class QLegendMarkerPrivate; | |
33 | class QAbstractSeries; |
|
33 | class QAbstractSeries; | |
34 | class QLegend; |
|
34 | class QLegend; | |
35 |
|
35 | |||
36 | class QTCOMMERCIALCHART_EXPORT QLegendMarker : public QObject |
|
36 | class QTCOMMERCIALCHART_EXPORT QLegendMarker : public QObject | |
37 | { |
|
37 | { | |
38 | Q_OBJECT |
|
38 | Q_OBJECT | |
39 |
|
39 | |||
40 | public: |
|
40 | public: | |
41 | enum LegendMarkerType { |
|
41 | enum LegendMarkerType { | |
42 | LegendMarkerTypeArea, |
|
42 | LegendMarkerTypeArea, | |
43 | LegendMarkerTypeBar, |
|
43 | LegendMarkerTypeBar, | |
44 | LegendMarkerTypePie, |
|
44 | LegendMarkerTypePie, | |
45 | LegendMarkerTypeXY |
|
45 | LegendMarkerTypeXY, | |
|
46 | LegendMarkerTypeBoxPlot | |||
46 | }; |
|
47 | }; | |
47 |
|
48 | |||
48 | Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged) |
|
49 | Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged) | |
49 | Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged) |
|
50 | Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged) | |
50 | Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) |
|
51 | Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) | |
51 | Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged) |
|
52 | Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged) | |
52 | Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged) |
|
53 | Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged) | |
53 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) |
|
54 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) | |
54 | Q_ENUMS(LegendMarkerType) |
|
55 | Q_ENUMS(LegendMarkerType) | |
55 |
|
56 | |||
56 | public: |
|
57 | public: | |
57 | virtual ~QLegendMarker(); |
|
58 | virtual ~QLegendMarker(); | |
58 | virtual LegendMarkerType type() = 0; |
|
59 | virtual LegendMarkerType type() = 0; | |
59 |
|
60 | |||
60 | QString label() const; |
|
61 | QString label() const; | |
61 | void setLabel(const QString &label); |
|
62 | void setLabel(const QString &label); | |
62 |
|
63 | |||
63 | QBrush labelBrush() const; |
|
64 | QBrush labelBrush() const; | |
64 | void setLabelBrush(const QBrush &brush); |
|
65 | void setLabelBrush(const QBrush &brush); | |
65 |
|
66 | |||
66 | QFont font() const; |
|
67 | QFont font() const; | |
67 | void setFont(const QFont &font); |
|
68 | void setFont(const QFont &font); | |
68 |
|
69 | |||
69 | QPen pen() const; |
|
70 | QPen pen() const; | |
70 | void setPen(const QPen &pen); |
|
71 | void setPen(const QPen &pen); | |
71 |
|
72 | |||
72 | QBrush brush() const; |
|
73 | QBrush brush() const; | |
73 | void setBrush(const QBrush &brush); |
|
74 | void setBrush(const QBrush &brush); | |
74 |
|
75 | |||
75 | bool isVisible() const; |
|
76 | bool isVisible() const; | |
76 | void setVisible(bool visible); |
|
77 | void setVisible(bool visible); | |
77 |
|
78 | |||
78 | virtual QAbstractSeries* series() = 0; |
|
79 | virtual QAbstractSeries* series() = 0; | |
79 |
|
80 | |||
80 | Q_SIGNALS: |
|
81 | Q_SIGNALS: | |
81 | void clicked(); |
|
82 | void clicked(); | |
82 | void hovered(bool status); |
|
83 | void hovered(bool status); | |
83 | void labelChanged(); |
|
84 | void labelChanged(); | |
84 | void labelBrushChanged(); |
|
85 | void labelBrushChanged(); | |
85 | void fontChanged(); |
|
86 | void fontChanged(); | |
86 | void penChanged(); |
|
87 | void penChanged(); | |
87 | void brushChanged(); |
|
88 | void brushChanged(); | |
88 | void visibleChanged(); |
|
89 | void visibleChanged(); | |
89 |
|
90 | |||
90 | protected: |
|
91 | protected: | |
91 | explicit QLegendMarker(QLegendMarkerPrivate &d, QObject *parent = 0); |
|
92 | explicit QLegendMarker(QLegendMarkerPrivate &d, QObject *parent = 0); | |
92 |
|
93 | |||
93 | QScopedPointer<QLegendMarkerPrivate> d_ptr; |
|
94 | QScopedPointer<QLegendMarkerPrivate> d_ptr; | |
94 | Q_DISABLE_COPY(QLegendMarker) |
|
95 | Q_DISABLE_COPY(QLegendMarker) | |
95 | friend class QLegendPrivate; |
|
96 | friend class QLegendPrivate; | |
96 | friend class QLegendMarkerPrivate; |
|
97 | friend class QLegendMarkerPrivate; | |
97 | friend class LegendMarkerItem; |
|
98 | friend class LegendMarkerItem; | |
98 | friend class LegendLayout; |
|
99 | friend class LegendLayout; | |
99 | friend class LegendScroller; |
|
100 | friend class LegendScroller; | |
100 | }; |
|
101 | }; | |
101 |
|
102 | |||
102 | QTCOMMERCIALCHART_END_NAMESPACE |
|
103 | QTCOMMERCIALCHART_END_NAMESPACE | |
103 |
|
104 | |||
104 | #endif // QLEGENDMARKER_H |
|
105 | #endif // QLEGENDMARKER_H |
@@ -1,97 +1,98 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 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(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) |
|
39 | Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) | |
40 | Q_PROPERTY(SeriesType type READ type) |
|
40 | Q_PROPERTY(SeriesType type READ type) | |
41 | Q_ENUMS(SeriesType) |
|
41 | Q_ENUMS(SeriesType) | |
42 |
|
42 | |||
43 | public: |
|
43 | public: | |
44 | enum SeriesType { |
|
44 | enum SeriesType { | |
45 | SeriesTypeLine, |
|
45 | SeriesTypeLine, | |
46 | SeriesTypeArea, |
|
46 | SeriesTypeArea, | |
47 | SeriesTypeBar, |
|
47 | SeriesTypeBar, | |
48 | SeriesTypeStackedBar, |
|
48 | SeriesTypeStackedBar, | |
49 | SeriesTypePercentBar, |
|
49 | SeriesTypePercentBar, | |
50 | SeriesTypePie, |
|
50 | SeriesTypePie, | |
51 | SeriesTypeScatter, |
|
51 | SeriesTypeScatter, | |
52 | SeriesTypeSpline, |
|
52 | SeriesTypeSpline, | |
53 | SeriesTypeHorizontalBar, |
|
53 | SeriesTypeHorizontalBar, | |
54 | SeriesTypeHorizontalStackedBar, |
|
54 | SeriesTypeHorizontalStackedBar, | |
55 | SeriesTypeHorizontalPercentBar |
|
55 | SeriesTypeHorizontalPercentBar, | |
|
56 | SeriesTypeBoxPlot | |||
56 | }; |
|
57 | }; | |
57 |
|
58 | |||
58 | protected: |
|
59 | protected: | |
59 | QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0); |
|
60 | QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0); | |
60 |
|
61 | |||
61 | public: |
|
62 | public: | |
62 | ~QAbstractSeries(); |
|
63 | ~QAbstractSeries(); | |
63 | virtual SeriesType type() const = 0; |
|
64 | virtual SeriesType type() const = 0; | |
64 |
|
65 | |||
65 | void setName(const QString &name); |
|
66 | void setName(const QString &name); | |
66 | QString name() const; |
|
67 | QString name() const; | |
67 | void setVisible(bool visible = true); |
|
68 | void setVisible(bool visible = true); | |
68 | bool isVisible() const; |
|
69 | bool isVisible() const; | |
69 | qreal opacity() const; |
|
70 | qreal opacity() const; | |
70 | void setOpacity(qreal opacity); |
|
71 | void setOpacity(qreal opacity); | |
71 |
|
72 | |||
72 | QChart *chart() const; |
|
73 | QChart *chart() const; | |
73 |
|
74 | |||
74 | bool attachAxis(QAbstractAxis* axis); |
|
75 | bool attachAxis(QAbstractAxis* axis); | |
75 | bool detachAxis(QAbstractAxis* axis); |
|
76 | bool detachAxis(QAbstractAxis* axis); | |
76 | QList<QAbstractAxis*> attachedAxes(); |
|
77 | QList<QAbstractAxis*> attachedAxes(); | |
77 |
|
78 | |||
78 | void show(); |
|
79 | void show(); | |
79 | void hide(); |
|
80 | void hide(); | |
80 |
|
81 | |||
81 | Q_SIGNALS: |
|
82 | Q_SIGNALS: | |
82 | void nameChanged(); |
|
83 | void nameChanged(); | |
83 | void visibleChanged(); |
|
84 | void visibleChanged(); | |
84 | void opacityChanged(); |
|
85 | void opacityChanged(); | |
85 |
|
86 | |||
86 | protected: |
|
87 | protected: | |
87 | QScopedPointer<QAbstractSeriesPrivate> d_ptr; |
|
88 | QScopedPointer<QAbstractSeriesPrivate> d_ptr; | |
88 | friend class ChartDataSet; |
|
89 | friend class ChartDataSet; | |
89 | friend class ChartPresenter; |
|
90 | friend class ChartPresenter; | |
90 | friend class ChartThemeManager; |
|
91 | friend class ChartThemeManager; | |
91 | friend class QLegendPrivate; |
|
92 | friend class QLegendPrivate; | |
92 | friend class DeclarativeChart; |
|
93 | friend class DeclarativeChart; | |
93 | }; |
|
94 | }; | |
94 |
|
95 | |||
95 | QTCOMMERCIALCHART_END_NAMESPACE |
|
96 | QTCOMMERCIALCHART_END_NAMESPACE | |
96 |
|
97 | |||
97 | #endif // QABSTRACTSERIES_H |
|
98 | #endif // QABSTRACTSERIES_H |
General Comments 0
You need to be logged in to leave comments.
Login now