##// END OF EJS Templates
Legend marker rect color now follows the text color
Tero Ahola -
r1795:dc2f639d372e
parent child
Show More
@@ -54,7 +54,6 LegendMarker::LegendMarker(QAbstractSeries *series, QLegend *legend) :
54 void LegendMarker::setPen(const QPen &pen)
54 void LegendMarker::setPen(const QPen &pen)
55 {
55 {
56 m_rectItem->setPen(pen);
56 m_rectItem->setPen(pen);
57 m_textItem->setPen(pen);
58 }
57 }
59
58
60 QPen LegendMarker::pen() const
59 QPen LegendMarker::pen() const
@@ -299,6 +299,9 void QLegend::setLabelBrush(const QBrush &brush)
299 d_ptr->m_labelBrush = brush;
299 d_ptr->m_labelBrush = brush;
300 foreach (LegendMarker *marker, d_ptr->markers()) {
300 foreach (LegendMarker *marker, d_ptr->markers()) {
301 marker->setLabelBrush(d_ptr->m_labelBrush);
301 marker->setLabelBrush(d_ptr->m_labelBrush);
302 // Note: The pen of the marker rectangle could be exposed in the public QLegend API
303 // instead of mapping it from label brush color
304 marker->setPen(brush.color());
302 }
305 }
303 emit labelColorChanged(brush.color());
306 emit labelColorChanged(brush.color());
304 }
307 }
General Comments 0
You need to be logged in to leave comments. Login now