##// END OF EJS Templates
pie: implement hiding the series
Jani Honkonen -
r1456:0ba1c6e91aeb
parent child
Show More
@@ -38,6 +38,7 PieChartItem::PieChartItem(QPieSeries *series, ChartPresenter* presenter)
38 {
38 {
39 Q_ASSERT(series);
39 Q_ASSERT(series);
40
40
41 connect(series, SIGNAL(visibleChanged()), this, SLOT(handleSeriesVisibleChanged()));
41 connect(series, SIGNAL(added(QList<QPieSlice*>)), this, SLOT(handleSlicesAdded(QList<QPieSlice*>)));
42 connect(series, SIGNAL(added(QList<QPieSlice*>)), this, SLOT(handleSlicesAdded(QList<QPieSlice*>)));
42 connect(series, SIGNAL(removed(QList<QPieSlice*>)), this, SLOT(handleSlicesRemoved(QList<QPieSlice*>)));
43 connect(series, SIGNAL(removed(QList<QPieSlice*>)), this, SLOT(handleSlicesRemoved(QList<QPieSlice*>)));
43 connect(series, SIGNAL(horizontalPositionChanged()), this, SLOT(updateLayout()));
44 connect(series, SIGNAL(horizontalPositionChanged()), this, SLOT(updateLayout()));
@@ -196,6 +197,11 void PieChartItem::handleSliceChanged()
196 update();
197 update();
197 }
198 }
198
199
200 void PieChartItem::handleSeriesVisibleChanged()
201 {
202 setVisible(m_series->isVisible());
203 }
204
199 PieSliceData PieChartItem::updateSliceGeometry(QPieSlice *slice)
205 PieSliceData PieChartItem::updateSliceGeometry(QPieSlice *slice)
200 {
206 {
201 PieSliceData &sliceData = QPieSlicePrivate::fromSlice(slice)->m_data;
207 PieSliceData &sliceData = QPieSlicePrivate::fromSlice(slice)->m_data;
@@ -62,6 +62,7 public Q_SLOTS:
62 void handleSlicesAdded(QList<QPieSlice*> slices);
62 void handleSlicesAdded(QList<QPieSlice*> slices);
63 void handleSlicesRemoved(QList<QPieSlice*> slices);
63 void handleSlicesRemoved(QList<QPieSlice*> slices);
64 void handleSliceChanged();
64 void handleSliceChanged();
65 void handleSeriesVisibleChanged();
65
66
66 private:
67 private:
67 PieSliceData updateSliceGeometry(QPieSlice *slice);
68 PieSliceData updateSliceGeometry(QPieSlice *slice);
General Comments 0
You need to be logged in to leave comments. Login now