##// END OF EJS Templates
bugfix: notifying legend before barchartitem caused crash in some situations
sauimone -
r1437:880bb87d5c97
parent child
Show More
@@ -587,10 +587,10 bool QBarSeriesPrivate::append(QBarSet *set)
587 m_barSets.append(set);
587 m_barSets.append(set);
588 QObject::connect(set->d_ptr.data(), SIGNAL(updatedBars()), this, SIGNAL(updatedBars()));
588 QObject::connect(set->d_ptr.data(), SIGNAL(updatedBars()), this, SIGNAL(updatedBars()));
589 QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBars()), this, SIGNAL(restructuredBars()));
589 QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBars()), this, SIGNAL(restructuredBars()));
590 emit restructuredBars(); // this notifies barchartitem
590 if (m_dataset) {
591 if (m_dataset) {
591 m_dataset->updateSeries(q); // this notifies legend
592 m_dataset->updateSeries(q); // this notifies legend
592 }
593 }
593 emit restructuredBars(); // this notifies barchartitem
594 return true;
594 return true;
595 }
595 }
596
596
@@ -604,10 +604,10 bool QBarSeriesPrivate::remove(QBarSet *set)
604 m_barSets.removeOne(set);
604 m_barSets.removeOne(set);
605 QObject::disconnect(set->d_ptr.data(), SIGNAL(updatedBars()), this, SIGNAL(updatedBars()));
605 QObject::disconnect(set->d_ptr.data(), SIGNAL(updatedBars()), this, SIGNAL(updatedBars()));
606 QObject::disconnect(set->d_ptr.data(), SIGNAL(restructuredBars()), this, SIGNAL(restructuredBars()));
606 QObject::disconnect(set->d_ptr.data(), SIGNAL(restructuredBars()), this, SIGNAL(restructuredBars()));
607 emit restructuredBars(); // this notifies barchartitem
607 if (m_dataset) {
608 if (m_dataset) {
608 m_dataset->updateSeries(q); // this notifies legend
609 m_dataset->updateSeries(q); // this notifies legend
609 }
610 }
610 emit restructuredBars(); // this notifies barchartitem
611 return true;
611 return true;
612 }
612 }
613
613
@@ -630,10 +630,10 bool QBarSeriesPrivate::append(QList<QBarSet* > sets)
630 QObject::connect(set->d_ptr.data(), SIGNAL(updatedBars()), this, SIGNAL(updatedBars()));
630 QObject::connect(set->d_ptr.data(), SIGNAL(updatedBars()), this, SIGNAL(updatedBars()));
631 QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBars()), this, SIGNAL(restructuredBars()));
631 QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBars()), this, SIGNAL(restructuredBars()));
632 }
632 }
633 emit restructuredBars(); // this notifies barchartitem
633 if (m_dataset) {
634 if (m_dataset) {
634 m_dataset->updateSeries(q); // this notifies legend
635 m_dataset->updateSeries(q); // this notifies legend
635 }
636 }
636 emit restructuredBars(); // this notifies barchartitem
637 return true;
637 return true;
638 }
638 }
639
639
@@ -660,10 +660,10 bool QBarSeriesPrivate::remove(QList<QBarSet* > sets)
660 QObject::disconnect(set->d_ptr.data(), SIGNAL(restructuredBars()), this, SIGNAL(restructuredBars()));
660 QObject::disconnect(set->d_ptr.data(), SIGNAL(restructuredBars()), this, SIGNAL(restructuredBars()));
661 }
661 }
662
662
663 emit restructuredBars(); // this notifies barchartitem
663 if (m_dataset) {
664 if (m_dataset) {
664 m_dataset->updateSeries(q); // this notifies legend
665 m_dataset->updateSeries(q); // this notifies legend
665 }
666 }
666 emit restructuredBars(); // this notifies barchartitem
667 return true;
667 return true;
668 }
668 }
669
669
@@ -677,10 +677,10 bool QBarSeriesPrivate::insert(int index, QBarSet *set)
677 m_barSets.insert(index, set);
677 m_barSets.insert(index, set);
678 QObject::connect(set->d_ptr.data(), SIGNAL(updatedBars()), this, SIGNAL(updatedBars()));
678 QObject::connect(set->d_ptr.data(), SIGNAL(updatedBars()), this, SIGNAL(updatedBars()));
679 QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBars()), this, SIGNAL(restructuredBars()));
679 QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBars()), this, SIGNAL(restructuredBars()));
680 emit restructuredBars(); // this notifies barchartitem
680 if (m_dataset) {
681 if (m_dataset) {
681 m_dataset->updateSeries(q); // this notifies legend
682 m_dataset->updateSeries(q); // this notifies legend
682 }
683 }
683 emit restructuredBars(); // this notifies barchartitem
684 return true;
684 return true;
685 }
685 }
686
686
General Comments 0
You need to be logged in to leave comments. Login now