From dc2f639d372e9b1e4f72a6501ddbc4005197706f 2012-08-20 09:02:42 From: Tero Ahola Date: 2012-08-20 09:02:42 Subject: [PATCH] Legend marker rect color now follows the text color --- diff --git a/src/legend/legendmarker.cpp b/src/legend/legendmarker.cpp index 2dfba74..e6c370f 100644 --- a/src/legend/legendmarker.cpp +++ b/src/legend/legendmarker.cpp @@ -54,7 +54,6 @@ LegendMarker::LegendMarker(QAbstractSeries *series, QLegend *legend) : void LegendMarker::setPen(const QPen &pen) { m_rectItem->setPen(pen); - m_textItem->setPen(pen); } QPen LegendMarker::pen() const diff --git a/src/legend/qlegend.cpp b/src/legend/qlegend.cpp index b523776..310c540 100644 --- a/src/legend/qlegend.cpp +++ b/src/legend/qlegend.cpp @@ -299,6 +299,9 @@ void QLegend::setLabelBrush(const QBrush &brush) d_ptr->m_labelBrush = brush; foreach (LegendMarker *marker, d_ptr->markers()) { marker->setLabelBrush(d_ptr->m_labelBrush); + // Note: The pen of the marker rectangle could be exposed in the public QLegend API + // instead of mapping it from label brush color + marker->setPen(brush.color()); } emit labelColorChanged(brush.color()); }