diff --git a/src/linechart/linechartitem.cpp b/src/linechart/linechartitem.cpp index 5daafc0..804dc5a 100644 --- a/src/linechart/linechartitem.cpp +++ b/src/linechart/linechartitem.cpp @@ -102,11 +102,13 @@ void LineChartItem::clearView() void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - Q_UNUSED(widget); + Q_UNUSED(widget); Q_UNUSED(option); + painter->save(); painter->setPen(m_pen); painter->setClipRect(m_clipRect); - painter->drawPath(m_path); + painter->drawPath(m_path); + painter->restore(); } void LineChartItem::calculatePoint(QPointF& point, int index, const QLineChartSeries* series,const QSizeF& size, const Domain& domain) const diff --git a/test/qmlchart/qml/qmlchart/main.qml b/test/qmlchart/qml/qmlchart/main.qml index 8a75b2d..87ba5e2 100644 --- a/test/qmlchart/qml/qmlchart/main.qml +++ b/test/qmlchart/qml/qmlchart/main.qml @@ -43,12 +43,9 @@ Rectangle { seriesType: Series.SeriesTypePie } - // TODO: a bug: drawing order affects the drawing; if you draw chart1 first (by changing the - // z-order), then chart2 is not shown at all. By drawing chart2 first, both are visible. - // Also, if you don't draw line series on chart1 (only pie), both charts are visible. -// Series { -// seriesType: Series.SeriesTypeLine -// } + Series { + seriesType: Series.SeriesTypeLine + } // TODO: // Series { // seriesType: Series.SeriesTypeBar