From 891ed0097501b4fb27cda2f6ae97e739c44ea4e6 2015-09-07 12:01:14 From: Miikka Heikkinen Date: 2015-09-07 12:01:14 Subject: [PATCH] Check that areaseries is actually in chart before trying to update. When a line series is used both as a series on chart and as an area series boundary, but not at the same time, animation can sometimes get confused as to what series to update if the area series is removed from the chart and the line series is added to the chart while a series animation is running. Task-number: QTRD-3445 Change-Id: Ia3d72d3ceba784b6e162b2c9b678acdc3e3ffcac Reviewed-by: Titta Heikkala --- diff --git a/src/charts/areachart/areachartitem_p.h b/src/charts/areachart/areachartitem_p.h index 5852e17..216994d 100644 --- a/src/charts/areachart/areachartitem_p.h +++ b/src/charts/areachart/areachartitem_p.h @@ -110,14 +110,17 @@ public: void updateGeometry() { - // Turn off points drawing from component line chart item, as that - // messes up the fill for area series. - suppressPoints(); - // Component lineseries are not necessarily themselves on the chart, - // so get the chart type for them from area chart. - forceChartType(m_item->series()->chart()->chartType()); - LineChartItem::updateGeometry(); - m_item->updatePath(); + // Make sure the series is in a chart before trying to update + if (m_item->series()->chart()) { + // Turn off points drawing from component line chart item, as that + // messes up the fill for area series. + suppressPoints(); + // Component lineseries are not necessarily themselves on the chart, + // so get the chart type for them from area chart. + forceChartType(m_item->series()->chart()->chartType()); + LineChartItem::updateGeometry(); + m_item->updatePath(); + } } private: