From 5facde66eb08a08e0a81a0567943ec507b729202 2012-03-07 13:04:36 From: Tero Ahola Date: 2012-03-07 13:04:36 Subject: [PATCH] Z order for pie --- diff --git a/examples/examples.pro b/examples/examples.pro index a82f6ed..4103cfd 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -18,4 +18,5 @@ SUBDIRS += linechart \ scatterinteractions \ splinechart \ areachart \ - stackedbarchartdrilldown + stackedbarchartdrilldown \ + customcolors diff --git a/src/chartpresenter_p.h b/src/chartpresenter_p.h index 3fcb629..f7a4cd4 100644 --- a/src/chartpresenter_p.h +++ b/src/chartpresenter_p.h @@ -26,7 +26,8 @@ public: GridZValue, AxisZValue, LineChartZValue, - ScatterSeriesZValue + ScatterSeriesZValue, + PieSeriesZValue }; ChartPresenter(QChart* chart,ChartDataSet *dataset); diff --git a/src/piechart/piepresenter.cpp b/src/piechart/piepresenter.cpp index 8d3224d..88ea7bd 100644 --- a/src/piechart/piepresenter.cpp +++ b/src/piechart/piepresenter.cpp @@ -2,6 +2,7 @@ #include "pieslice_p.h" #include "qpieslice.h" #include "qpieseries.h" +#include "chartpresenter_p.h" #include #include @@ -22,6 +23,9 @@ PiePresenter::PiePresenter(QGraphicsItem *parent, QPieSeries *series) changeSet.appendAdded(m_series->m_slices); handleSeriesChanged(changeSet); } + + // Note: the following does not affect as long as the item does not have anything to paint + setZValue(ChartPresenter::PieSeriesZValue); } PiePresenter::~PiePresenter() diff --git a/src/piechart/pieslice.cpp b/src/piechart/pieslice.cpp index 9f3d203..7634f59 100644 --- a/src/piechart/pieslice.cpp +++ b/src/piechart/pieslice.cpp @@ -2,6 +2,7 @@ #include "piepresenter_p.h" #include "qpieseries.h" #include "qpieslice.h" +#include "chartpresenter_p.h" #include #include #include @@ -31,6 +32,7 @@ PieSlice::PieSlice(QGraphicsItem* parent) { setAcceptHoverEvents(true); setAcceptedMouseButtons(Qt::LeftButton); + setZValue(ChartPresenter::PieSeriesZValue); } PieSlice::~PieSlice()