@@ -1,91 +1,92 | |||||
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 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 | enum LegendMarkerType { |
|
41 | enum LegendMarkerType { | |
41 | LegendMarkerTypeArea, |
|
42 | LegendMarkerTypeArea, | |
42 | LegendMarkerTypeBar, |
|
43 | LegendMarkerTypeBar, | |
43 | LegendMarkerTypePie, |
|
44 | LegendMarkerTypePie, | |
44 | LegendMarkerTypeXY |
|
45 | LegendMarkerTypeXY | |
45 | }; |
|
46 | }; | |
46 |
|
47 | |||
47 | // TODO: |
|
48 | // TODO: | |
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(QPen pen READ pen WRITE setPen NOTIFY penChanged); |
|
50 | // Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged); | |
50 | // Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged); |
|
51 | // Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged); | |
51 |
|
52 | |||
52 | public: |
|
53 | public: | |
53 | virtual ~QLegendMarker(); |
|
54 | virtual ~QLegendMarker(); | |
54 | virtual LegendMarkerType type() = 0; |
|
55 | virtual LegendMarkerType type() = 0; | |
55 |
|
56 | |||
56 | QString label() const; |
|
57 | QString label() const; | |
57 | void setLabel(const QString &label); |
|
58 | void setLabel(const QString &label); | |
58 |
|
59 | |||
59 | QBrush labelBrush() const; |
|
60 | QBrush labelBrush() const; | |
60 | void setLabelBrush(const QBrush &brush); |
|
61 | void setLabelBrush(const QBrush &brush); | |
61 |
|
62 | |||
62 | QFont font() const; |
|
63 | QFont font() const; | |
63 | void setFont(const QFont &font); |
|
64 | void setFont(const QFont &font); | |
64 |
|
65 | |||
65 | QPen pen() const; |
|
66 | QPen pen() const; | |
66 | void setPen(const QPen &pen); |
|
67 | void setPen(const QPen &pen); | |
67 |
|
68 | |||
68 | QBrush brush() const; |
|
69 | QBrush brush() const; | |
69 | void setBrush(const QBrush &brush); |
|
70 | void setBrush(const QBrush &brush); | |
70 |
|
71 | |||
71 | bool isVisible() const; |
|
72 | bool isVisible() const; | |
72 | void setVisible(bool visible); |
|
73 | void setVisible(bool visible); | |
73 |
|
74 | |||
74 | protected: |
|
75 | protected: | |
75 | explicit QLegendMarker(QLegendMarkerPrivate &d, QObject *parent = 0); |
|
76 | explicit QLegendMarker(QLegendMarkerPrivate &d, QObject *parent = 0); | |
76 |
|
77 | |||
77 | Q_SIGNALS: |
|
78 | Q_SIGNALS: | |
78 | void clicked(); |
|
79 | void clicked(); | |
79 | void hovered(bool status); |
|
80 | void hovered(bool status); | |
80 |
|
81 | |||
81 | protected: |
|
82 | protected: | |
82 | QScopedPointer<QLegendMarkerPrivate> d_ptr; |
|
83 | QScopedPointer<QLegendMarkerPrivate> d_ptr; | |
83 | Q_DISABLE_COPY(QLegendMarker) |
|
84 | Q_DISABLE_COPY(QLegendMarker) | |
84 | friend class QLegendPrivate; |
|
85 | friend class QLegendPrivate; | |
85 | friend class QLegendMarkerPrivate; |
|
86 | friend class QLegendMarkerPrivate; | |
86 | friend class LegendLayout; |
|
87 | friend class LegendLayout; | |
87 | }; |
|
88 | }; | |
88 |
|
89 | |||
89 | QTCOMMERCIALCHART_END_NAMESPACE |
|
90 | QTCOMMERCIALCHART_END_NAMESPACE | |
90 |
|
91 | |||
91 | #endif // QLEGENDMARKER_H |
|
92 | #endif // QLEGENDMARKER_H |
General Comments 0
You need to be logged in to leave comments.
Login now