From 235cef4135ee65cd566a8b9db8cbb3f694bf425e 2014-04-01 10:53:33 From: Titta Heikkala Date: 2014-04-01 10:53:33 Subject: [PATCH] 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 --- diff --git a/src/boxplotchart/boxplotchartitem.cpp b/src/boxplotchart/boxplotchartitem.cpp index eff7388..ff32041 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()); }