@@ -197,6 +197,8 void PieChartItem::handleSlicesRemoved(QList<QPieSlice*> slices) | |||||
197 | continue; |
|
197 | continue; | |
198 |
|
198 | |||
199 | m_sliceItems.remove(slice); |
|
199 | m_sliceItems.remove(slice); | |
|
200 | slice->disconnect(this); | |||
|
201 | QPieSlicePrivate::fromSlice(slice)->disconnect(this); | |||
200 |
|
202 | |||
201 | if (m_animation) |
|
203 | if (m_animation) | |
202 | presenter()->startAnimation(m_animation->removeSlice(sliceItem)); // animator deletes the PieSliceItem |
|
204 | presenter()->startAnimation(m_animation->removeSlice(sliceItem)); // animator deletes the PieSliceItem |
@@ -532,6 +532,7 bool QPieSeries::take(QPieSlice* slice) | |||||
532 | return false; |
|
532 | return false; | |
533 |
|
533 | |||
534 | QPieSlicePrivate::fromSlice(slice)->m_series = 0; |
|
534 | QPieSlicePrivate::fromSlice(slice)->m_series = 0; | |
|
535 | slice->disconnect(d); | |||
535 |
|
536 | |||
536 | d->updateDerivativeData(); |
|
537 | d->updateDerivativeData(); | |
537 |
|
538 | |||
@@ -551,15 +552,16 void QPieSeries::clear() | |||||
551 | return; |
|
552 | return; | |
552 |
|
553 | |||
553 | QList<QPieSlice*> slices = d->m_slices; |
|
554 | QList<QPieSlice*> slices = d->m_slices; | |
554 |
foreach (QPieSlice* s, d->m_slices) |
|
555 | foreach (QPieSlice* s, d->m_slices) | |
555 | d->m_slices.removeOne(s); |
|
556 | d->m_slices.removeOne(s); | |
556 | delete s; |
|
|||
557 | } |
|
|||
558 |
|
557 | |||
559 | d->updateDerivativeData(); |
|
558 | d->updateDerivativeData(); | |
560 |
|
559 | |||
561 | emit removed(slices); |
|
560 | emit removed(slices); | |
562 | emit countChanged(); |
|
561 | emit countChanged(); | |
|
562 | ||||
|
563 | foreach (QPieSlice* s, slices) | |||
|
564 | delete s; | |||
563 | } |
|
565 | } | |
564 |
|
566 | |||
565 | /*! |
|
567 | /*! |
General Comments 0
You need to be logged in to leave comments.
Login now