##// END OF EJS Templates
Prevent double adding slice pointer to series with Q_ASSERT
Jani Honkonen -
r1092:f123347f2951
parent child
Show More
@@ -144,6 +144,7 void QPieSeries::append(QList<QPieSlice*> slices)
144 Q_D(QPieSeries);
144 Q_D(QPieSeries);
145
145
146 foreach (QPieSlice* s, slices) {
146 foreach (QPieSlice* s, slices) {
147 Q_ASSERT(!d->m_slices.contains(s)); // cannot add same slice twice
147 s->setParent(this);
148 s->setParent(this);
148 d->m_slices << s;
149 d->m_slices << s;
149 }
150 }
@@ -198,6 +199,7 void QPieSeries::insert(int index, QPieSlice* slice)
198 {
199 {
199 Q_D(QPieSeries);
200 Q_D(QPieSeries);
200 Q_ASSERT(index <= d->m_slices.count());
201 Q_ASSERT(index <= d->m_slices.count());
202 Q_ASSERT(!d->m_slices.contains(slice)); // cannot add same slice twice
201 slice->setParent(this);
203 slice->setParent(this);
202 d->m_slices.insert(index, slice);
204 d->m_slices.insert(index, slice);
203
205
General Comments 0
You need to be logged in to leave comments. Login now