@@ -1,94 +1,95 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2012 Digia Plc |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
8 | 8 | ** |
|
9 | 9 | ** $QT_BEGIN_LICENSE$ |
|
10 | 10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
11 | 11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
12 | 12 | ** Software or, alternatively, in accordance with the terms contained in |
|
13 | 13 | ** a written agreement between you and Digia. |
|
14 | 14 | ** |
|
15 | 15 | ** If you have questions regarding the use of this file, please use |
|
16 | 16 | ** contact form at http://qt.digia.com |
|
17 | 17 | ** $QT_END_LICENSE$ |
|
18 | 18 | ** |
|
19 | 19 | ****************************************************************************/ |
|
20 | 20 | |
|
21 | 21 | #ifndef QLEGENDMARKER_H |
|
22 | 22 | #define QLEGENDMARKER_H |
|
23 | 23 | |
|
24 | 24 | #include <QChartGlobal> |
|
25 | 25 | #include <QObject> |
|
26 | 26 | #include <QPen> |
|
27 | 27 | #include <QBrush> |
|
28 | 28 | #include <QFont> |
|
29 | 29 | |
|
30 | 30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
31 | 31 | |
|
32 | 32 | class QLegendMarkerPrivate; |
|
33 | 33 | class QAbstractSeries; |
|
34 | 34 | class QLegend; |
|
35 | 35 | |
|
36 | 36 | class QTCOMMERCIALCHART_EXPORT QLegendMarker : public QObject |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | |
|
40 | 40 | public: |
|
41 | 41 | enum LegendMarkerType { |
|
42 | 42 | LegendMarkerTypeArea, |
|
43 | 43 | LegendMarkerTypeBar, |
|
44 | 44 | LegendMarkerTypePie, |
|
45 | 45 | LegendMarkerTypeXY |
|
46 | 46 | }; |
|
47 | 47 | |
|
48 | 48 | // TODO: |
|
49 | 49 | // Q_PROPERTY(QString label READ label WRITE setlabel NOTIFY labelChanged); |
|
50 | 50 | // Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged); |
|
51 | 51 | // Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged); |
|
52 | 52 | |
|
53 | 53 | public: |
|
54 | 54 | virtual ~QLegendMarker(); |
|
55 | 55 | virtual LegendMarkerType type() = 0; |
|
56 | 56 | |
|
57 | 57 | QString label() const; |
|
58 | 58 | void setLabel(const QString &label); |
|
59 | 59 | |
|
60 | 60 | QBrush labelBrush() const; |
|
61 | 61 | void setLabelBrush(const QBrush &brush); |
|
62 | 62 | |
|
63 | 63 | QFont font() const; |
|
64 | 64 | void setFont(const QFont &font); |
|
65 | 65 | |
|
66 | 66 | QPen pen() const; |
|
67 | 67 | void setPen(const QPen &pen); |
|
68 | 68 | |
|
69 | 69 | QBrush brush() const; |
|
70 | 70 | void setBrush(const QBrush &brush); |
|
71 | 71 | |
|
72 | 72 | bool isVisible() const; |
|
73 | 73 | void setVisible(bool visible); |
|
74 | 74 | |
|
75 | 75 | virtual QAbstractSeries* series() = 0; |
|
76 | 76 | |
|
77 | 77 | Q_SIGNALS: |
|
78 | 78 | void clicked(); |
|
79 | 79 | void hovered(bool status); |
|
80 | 80 | |
|
81 | 81 | protected: |
|
82 | 82 | explicit QLegendMarker(QLegendMarkerPrivate &d, QObject *parent = 0); |
|
83 | 83 | |
|
84 | 84 | QScopedPointer<QLegendMarkerPrivate> d_ptr; |
|
85 | 85 | Q_DISABLE_COPY(QLegendMarker) |
|
86 | 86 | friend class QLegendPrivate; |
|
87 | 87 | friend class QLegendMarkerPrivate; |
|
88 | 88 | friend class LegendMarkerItem; |
|
89 | 89 | friend class LegendLayout; |
|
90 | friend class LegendScroller; | |
|
90 | 91 | }; |
|
91 | 92 | |
|
92 | 93 | QTCOMMERCIALCHART_END_NAMESPACE |
|
93 | 94 | |
|
94 | 95 | #endif // QLEGENDMARKER_H |
General Comments 0
You need to be logged in to leave comments.
Login now