diff options
author | Titta Heikkala <titta.heikkala@digia.com> | 2014-04-01 13:37:59 +0300 |
---|---|---|
committer | Titta Heikkala <titta.heikkala@digia.com> | 2014-04-01 13:53:33 +0300 |
commit | 235cef4135ee65cd566a8b9db8cbb3f694bf425e (patch) | |
tree | 671644ad10b4b6ef9091ca56ef9137c4ef343bcf | |
parent | e4b34f179cba63380ed9503ac80ea588c9b74832 (diff) |
Fix QBoxSet color setting
The newly created box item should take the brush and pen from the series
only if they are not explicitly set for the box item already.
Task-number: QTRD-2624
Change-Id: Iafcb02c46b10be32bc155ff00a543803627e2591
Reviewed-by: Mika Salmela <mika.salmela@digia.com>
-rw-r--r-- | src/boxplotchart/boxplotchartitem.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/boxplotchart/boxplotchartitem.cpp b/src/boxplotchart/boxplotchartitem.cpp index eff7388c..ff320413 100644 --- a/src/boxplotchart/boxplotchartitem.cpp +++ b/src/boxplotchart/boxplotchartitem.cpp @@ -82,8 +82,15 @@ void BoxPlotChartItem::handleDataStructureChanged() connect(box, SIGNAL(hovered(bool, QBoxSet *)), set, SIGNAL(hovered(bool))); // Set the decorative issues for the newly created box - box->setBrush(m_series->brush()); - box->setPen(m_series->pen()); + // so that the brush and pen already defined for the set are kept. + if (set->brush() == Qt::NoBrush) + box->setBrush(m_series->brush()); + else + box->setBrush(set->brush()); + if (set->pen() == Qt::NoPen) + box->setPen(m_series->pen()); + else + box->setPen(set->pen()); box->setBoxOutlined(m_series->boxOutlineVisible()); box->setBoxWidth(m_series->boxWidth()); } |