@@ -37,6 +37,11 | |||
|
37 | 37 | <li><a href="qcategoryaxis.html">QCategoryAxis</a></li> |
|
38 | 38 | <li><a href="qdatetimeaxis.html">QDateTimeAxis</a></li> |
|
39 | 39 | <li><a href="qlegend.html">QLegend</a></li> |
|
40 | <li><a href="qlegendmarker.html">QLegendMarker</a></li> | |
|
41 | <li><a href="qpielegendmarker.html">QPieLegendMarker</a></li> | |
|
42 | <li><a href="qxylegendmarker.html">QXYLegendMarker</a></li> | |
|
43 | <li><a href="qbarlegendmarker.html">QBarLegendMarker</a></li> | |
|
44 | <li><a href="qarealegendmarker.html">QAreaLegendMarker</a></li> | |
|
40 | 45 | <li><a href="qabstractseries.html">QAbstractSeries</a></li> |
|
41 | 46 | <li><a href="qchartglobal.html">QChartGlobal</a></li> |
|
42 | 47 | </ul> |
@@ -25,11 +25,32 | |||
|
25 | 25 | |
|
26 | 26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | 27 | |
|
28 | /*! | |
|
29 | \class QAreaLegendMarker | |
|
30 | \brief QAreaLegendMarker object | |
|
31 | \mainclass | |
|
32 | ||
|
33 | QAreaLegendMarker is related to QAreaSeries. One QAreaSeries results in one marker. | |
|
34 | ||
|
35 | \sa QLegend QAreaSeries | |
|
36 | */ | |
|
37 | ||
|
38 | /*! | |
|
39 | \fn virtual LegendMarkerType QAreaLegendMarker::type() | |
|
40 | Returns QLegendMarker::LegendMarkerTypeArea | |
|
41 | */ | |
|
42 | ||
|
43 | /*! | |
|
44 | Constructor | |
|
45 | */ | |
|
28 | 46 | QAreaLegendMarker::QAreaLegendMarker(QAreaSeries *series, QLegend *legend, QObject *parent) : |
|
29 | 47 | QLegendMarker(*new QAreaLegendMarkerPrivate(this,series,legend), parent) |
|
30 | 48 | { |
|
31 | 49 | } |
|
32 | 50 | |
|
51 | /*! | |
|
52 | Destructor | |
|
53 | */ | |
|
33 | 54 | QAreaLegendMarker::~QAreaLegendMarker() |
|
34 | 55 | { |
|
35 | 56 | } |
@@ -42,6 +63,9 QAreaLegendMarker::QAreaLegendMarker(QAreaLegendMarkerPrivate &d, QObject *paren | |||
|
42 | 63 | { |
|
43 | 64 | } |
|
44 | 65 | |
|
66 | /*! | |
|
67 | Returns related series of marker | |
|
68 | */ | |
|
45 | 69 | QAreaSeries* QAreaLegendMarker::series() |
|
46 | 70 | { |
|
47 | 71 | Q_D(QAreaLegendMarker); |
@@ -25,11 +25,32 | |||
|
25 | 25 | |
|
26 | 26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | 27 | |
|
28 | /*! | |
|
29 | \class QBarLegendMarker | |
|
30 | \brief QBarLegendMarker object | |
|
31 | \mainclass | |
|
32 | ||
|
33 | QBarLegendMarker is related to QAbstractBarSeries derived classes. With bar series, each marker is related to one QBarSet. | |
|
34 | ||
|
35 | \sa QLegend QAbstractBarSeries QBarSet | |
|
36 | */ | |
|
37 | ||
|
38 | /*! | |
|
39 | \fn virtual LegendMarkerType QBarLegendMarker::type() | |
|
40 | Returns QLegendMarker::LegendMarkerTypeBar | |
|
41 | */ | |
|
42 | ||
|
43 | /*! | |
|
44 | Constructor | |
|
45 | */ | |
|
28 | 46 | QBarLegendMarker::QBarLegendMarker(QAbstractBarSeries *series, QBarSet *barset, QLegend *legend, QObject *parent) : |
|
29 | 47 | QLegendMarker(*new QBarLegendMarkerPrivate(this,series,barset,legend), parent) |
|
30 | 48 | { |
|
31 | 49 | } |
|
32 | 50 | |
|
51 | /*! | |
|
52 | Desturctor | |
|
53 | */ | |
|
33 | 54 | QBarLegendMarker::~QBarLegendMarker() |
|
34 | 55 | { |
|
35 | 56 | } |
@@ -42,12 +63,18 QBarLegendMarker::QBarLegendMarker(QBarLegendMarkerPrivate &d, QObject *parent) | |||
|
42 | 63 | { |
|
43 | 64 | } |
|
44 | 65 | |
|
66 | /*! | |
|
67 | Returns the related series of marker | |
|
68 | */ | |
|
45 | 69 | QAbstractBarSeries *QBarLegendMarker::series() |
|
46 | 70 | { |
|
47 | 71 | Q_D(QBarLegendMarker); |
|
48 | 72 | return d->m_series; |
|
49 | 73 | } |
|
50 | 74 | |
|
75 | /*! | |
|
76 | Returns the related barset of marker | |
|
77 | */ | |
|
51 | 78 | QBarSet* QBarLegendMarker::barset() |
|
52 | 79 | { |
|
53 | 80 | Q_D(QBarLegendMarker); |
@@ -381,6 +381,10 bool QLegend::isBackgroundVisible() const | |||
|
381 | 381 | return d_ptr->m_backgroundVisible; |
|
382 | 382 | } |
|
383 | 383 | |
|
384 | /*! | |
|
385 | Returns the list of markers in legend. The list can be filtered with \a series parameter. | |
|
386 | If \a series is given, only markers related to that series are returned. | |
|
387 | */ | |
|
384 | 388 | QList<QLegendMarker*> QLegend::markers(QAbstractSeries *series) const |
|
385 | 389 | { |
|
386 | 390 | return d_ptr->markers(series); |
@@ -30,6 +30,54 | |||
|
30 | 30 | |
|
31 | 31 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
32 | 32 | |
|
33 | /*! | |
|
34 | \class QLegendMarker | |
|
35 | \brief LegendMarker object | |
|
36 | \mainclass | |
|
37 | ||
|
38 | QLegendMarker is abstract object that can be used to access markers inside QLegend. The QLegendMarker is always connected | |
|
39 | to some series | |
|
40 | ||
|
41 | \image examples_legendmarkers.png | |
|
42 | ||
|
43 | \sa QLegend | |
|
44 | */ | |
|
45 | /*! | |
|
46 | \enum QLegendMarker::LegendMarkerType | |
|
47 | ||
|
48 | The type of the legendmarker object. | |
|
49 | ||
|
50 | \value LegendMarkerTypeArea | |
|
51 | \value LegendMarkerTypeBar | |
|
52 | \value LegendMarkerTypePie | |
|
53 | \value LegendMarkerTypeXY | |
|
54 | */ | |
|
55 | ||
|
56 | /*! | |
|
57 | \fn virtual LegendMarkerType QLegendMarker::type() = 0; | |
|
58 | Returns the type of legendmarker. Type depends of the related series. LegendMarkerTypeXY is used for all QXYSeries derived | |
|
59 | classes. | |
|
60 | */ | |
|
61 | ||
|
62 | /*! | |
|
63 | \fn virtual QAbstractSeries* QLegendMarker::series() = 0; | |
|
64 | Returns pointer to series, which is related to this marker. Marker is always related to some series. | |
|
65 | */ | |
|
66 | ||
|
67 | /*! | |
|
68 | \fn void QLegendMarker::clicked(); | |
|
69 | This signal is emitted, when marker is clicked with mouse. | |
|
70 | */ | |
|
71 | ||
|
72 | /*! | |
|
73 | \fn void QLegendMarker::hovered(bool status); | |
|
74 | This signal is emitted, when mouse is hovered over marker. \a status is true, when mouse enters the marker | |
|
75 | and false when it leaves the marker. | |
|
76 | */ | |
|
77 | ||
|
78 | /*! | |
|
79 | Constructor of marker | |
|
80 | */ | |
|
33 | 81 | QLegendMarker::QLegendMarker(QLegendMarkerPrivate &d, QObject *parent) : |
|
34 | 82 | QObject(parent), |
|
35 | 83 | d_ptr(&d) |
@@ -37,65 +85,103 QLegendMarker::QLegendMarker(QLegendMarkerPrivate &d, QObject *parent) : | |||
|
37 | 85 | d_ptr->m_item->setVisible(d_ptr->series()->isVisible()); |
|
38 | 86 | } |
|
39 | 87 | |
|
88 | /*! | |
|
89 | Destructor of marker | |
|
90 | */ | |
|
40 | 91 | QLegendMarker::~QLegendMarker() |
|
41 | 92 | { |
|
42 | 93 | } |
|
43 | 94 | |
|
95 | /*! | |
|
96 | Returns the label of the marker. | |
|
97 | */ | |
|
44 | 98 | QString QLegendMarker::label() const |
|
45 | 99 | { |
|
46 | 100 | return d_ptr->m_item->label(); |
|
47 | 101 | } |
|
48 | 102 | |
|
103 | /*! | |
|
104 | Sets the \a label of marker. Note that changing name of series will also change label of its marker. | |
|
105 | */ | |
|
49 | 106 | void QLegendMarker::setLabel(const QString &label) |
|
50 | 107 | { |
|
51 | 108 | d_ptr->m_item->setLabel(label); |
|
52 | 109 | } |
|
53 | ||
|
110 | /*! | |
|
111 | Returns the brush which is used to draw label. | |
|
112 | */ | |
|
54 | 113 | QBrush QLegendMarker::labelBrush() const |
|
55 | 114 | { |
|
56 | 115 | return d_ptr->m_item->labelBrush(); |
|
57 | 116 | } |
|
58 | 117 | |
|
118 | /*! | |
|
119 | Sets the \a brush of label | |
|
120 | */ | |
|
59 | 121 | void QLegendMarker::setLabelBrush(const QBrush &brush) |
|
60 | 122 | { |
|
61 | 123 | d_ptr->m_item->setLabelBrush(brush); |
|
62 | 124 | } |
|
63 | 125 | |
|
126 | /*! | |
|
127 | Retuns the font of label | |
|
128 | */ | |
|
64 | 129 | QFont QLegendMarker::font() const |
|
65 | 130 | { |
|
66 | 131 | return d_ptr->m_item->font(); |
|
67 | 132 | } |
|
68 | 133 | |
|
134 | /*! | |
|
135 | Sets the \a font of label | |
|
136 | */ | |
|
69 | 137 | void QLegendMarker::setFont(const QFont &font) |
|
70 | 138 | { |
|
71 | 139 | d_ptr->m_item->setFont(font); |
|
72 | 140 | } |
|
73 | 141 | |
|
142 | /*! | |
|
143 | Returns the pen of marker item | |
|
144 | */ | |
|
74 | 145 | QPen QLegendMarker::pen() const |
|
75 | 146 | { |
|
76 | 147 | return d_ptr->m_item->pen(); |
|
77 | 148 | } |
|
78 | 149 | |
|
150 | /*! | |
|
151 | Sets the \a pen of marker item | |
|
152 | */ | |
|
79 | 153 | void QLegendMarker::setPen(const QPen &pen) |
|
80 | 154 | { |
|
81 | 155 | d_ptr->m_item->setPen(pen); |
|
82 | 156 | } |
|
83 | 157 | |
|
158 | /*! | |
|
159 | Returns the brush of marker item | |
|
160 | */ | |
|
84 | 161 | QBrush QLegendMarker::brush() const |
|
85 | 162 | { |
|
86 | 163 | return d_ptr->m_item->brush(); |
|
87 | 164 | } |
|
88 | 165 | |
|
166 | /*! | |
|
167 | Sets the \a brush of marker item. Note that changing color of the series also changes this. | |
|
168 | */ | |
|
89 | 169 | void QLegendMarker::setBrush(const QBrush &brush) |
|
90 | 170 | { |
|
91 | 171 | d_ptr->m_item->setBrush(brush); |
|
92 | 172 | } |
|
93 | 173 | |
|
174 | /*! | |
|
175 | Returns visibility of the marker | |
|
176 | */ | |
|
94 | 177 | bool QLegendMarker::isVisible() const |
|
95 | 178 | { |
|
96 | 179 | return d_ptr->m_item->isVisible(); |
|
97 | 180 | } |
|
98 | 181 | |
|
182 | /*! | |
|
183 | Sets markers visibility to \a visible | |
|
184 | */ | |
|
99 | 185 | void QLegendMarker::setVisible(bool visible) |
|
100 | 186 | { |
|
101 | 187 | d_ptr->m_item->setVisible(visible); |
@@ -107,7 +193,6 QLegendMarkerPrivate::QLegendMarkerPrivate(QLegendMarker *q, QLegend *legend) : | |||
|
107 | 193 | q_ptr(q) |
|
108 | 194 | { |
|
109 | 195 | m_item = new LegendMarkerItem(this); |
|
110 | // m_item->setVisible(q->series()->isVisible()); | |
|
111 | 196 | } |
|
112 | 197 | |
|
113 | 198 | QLegendMarkerPrivate::~QLegendMarkerPrivate() |
@@ -119,8 +204,6 void QLegendMarkerPrivate::invalidateLegend() | |||
|
119 | 204 | m_legend->d_ptr->m_layout->invalidate(); |
|
120 | 205 | } |
|
121 | 206 | |
|
122 | ||
|
123 | ||
|
124 | 207 | #include "moc_qlegendmarker.cpp" |
|
125 | 208 | #include "moc_qlegendmarker_p.cpp" |
|
126 | 209 |
@@ -25,11 +25,32 | |||
|
25 | 25 | |
|
26 | 26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | 27 | |
|
28 | /*! | |
|
29 | \class QPieLegendMarker | |
|
30 | \brief LegendMarker object | |
|
31 | \mainclass | |
|
32 | ||
|
33 | QPieLegendMarker is related to QPieSeries. With QPieSeries, each slice of pie is related to one marker in QLegend. | |
|
34 | ||
|
35 | \sa QLegend QPieSeries QPieSlice | |
|
36 | */ | |
|
37 | ||
|
38 | /*! | |
|
39 | \fn virtual LegendMarkerType QPieLegendMarker::type() | |
|
40 | Returns QLegendMarker::LegendMarkerTypePie | |
|
41 | */ | |
|
42 | ||
|
43 | /*! | |
|
44 | Constructor | |
|
45 | */ | |
|
28 | 46 | QPieLegendMarker::QPieLegendMarker(QPieSeries *series, QPieSlice *slice, QLegend *legend, QObject *parent) : |
|
29 | 47 | QLegendMarker(*new QPieLegendMarkerPrivate(this,series,slice,legend), parent) |
|
30 | 48 | { |
|
31 | 49 | } |
|
32 | 50 | |
|
51 | /*! | |
|
52 | Destructor | |
|
53 | */ | |
|
33 | 54 | QPieLegendMarker::~QPieLegendMarker() |
|
34 | 55 | { |
|
35 | 56 | } |
@@ -42,12 +63,18 QPieLegendMarker::QPieLegendMarker(QPieLegendMarkerPrivate &d, QObject *parent) | |||
|
42 | 63 | { |
|
43 | 64 | } |
|
44 | 65 | |
|
66 | /*! | |
|
67 | Returns the related series of marker. | |
|
68 | */ | |
|
45 | 69 | QPieSeries* QPieLegendMarker::series() |
|
46 | 70 | { |
|
47 | 71 | Q_D(QPieLegendMarker); |
|
48 | 72 | return d->m_series; |
|
49 | 73 | } |
|
50 | 74 | |
|
75 | /*! | |
|
76 | Returns the related slice of marker. | |
|
77 | */ | |
|
51 | 78 | QPieSlice* QPieLegendMarker::slice() |
|
52 | 79 | { |
|
53 | 80 | Q_D(QPieLegendMarker); |
@@ -25,11 +25,32 | |||
|
25 | 25 | |
|
26 | 26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | 27 | |
|
28 | /*! | |
|
29 | \class QXYLegendMarker | |
|
30 | \brief QXYLegendMarker object | |
|
31 | \mainclass | |
|
32 | ||
|
33 | QXYLegendMarker is related to QXYSeries derived classes. Each marker is related to one series. | |
|
34 | ||
|
35 | \sa QLegend QXYSeries QSplineSeries QScatterSeries QLineSeries | |
|
36 | */ | |
|
37 | ||
|
38 | /*! | |
|
39 | \fn virtual LegendMarkerType QXYLegendMarker::type() | |
|
40 | Returns QLegendMarker::LegendMarkerTypeXY | |
|
41 | */ | |
|
42 | ||
|
43 | /*! | |
|
44 | Constructor | |
|
45 | */ | |
|
28 | 46 | QXYLegendMarker::QXYLegendMarker(QXYSeries *series, QLegend *legend, QObject *parent) : |
|
29 | 47 | QLegendMarker(*new QXYLegendMarkerPrivate(this,series,legend), parent) |
|
30 | 48 | { |
|
31 | 49 | } |
|
32 | 50 | |
|
51 | /*! | |
|
52 | Destructor | |
|
53 | */ | |
|
33 | 54 | QXYLegendMarker::~QXYLegendMarker() |
|
34 | 55 | { |
|
35 | 56 | } |
@@ -42,6 +63,9 QXYLegendMarker::QXYLegendMarker(QXYLegendMarkerPrivate &d, QObject *parent) : | |||
|
42 | 63 | { |
|
43 | 64 | } |
|
44 | 65 | |
|
66 | /*! | |
|
67 | Returns the related series | |
|
68 | */ | |
|
45 | 69 | QXYSeries* QXYLegendMarker::series() |
|
46 | 70 | { |
|
47 | 71 | Q_D(QXYLegendMarker); |
General Comments 0
You need to be logged in to leave comments.
Login now