##// END OF EJS Templates
Revert barseries thought to be only model related
Marek Rosa -
r1333:415d595f93c9
parent child
Show More
@@ -231,6 +231,23 QBarSeriesPrivate::QBarSeriesPrivate(QBarSeries *q) :
231 231 {
232 232 }
233 233
234 void QBarSeriesPrivate::setCategories(QStringList categories)
235 {
236 m_categories = categories;
237 }
238
239 void QBarSeriesPrivate::insertCategory(int index, const QString category)
240 {
241 m_categories.insert(index, category);
242 emit categoriesUpdated();
243 }
244
245 void QBarSeriesPrivate::removeCategory(int index)
246 {
247 m_categories.removeAt(index);
248 emit categoriesUpdated();
249 }
250
234 251 int QBarSeriesPrivate::categoryCount() const
235 252 {
236 253 if (m_categories.count() > 0) {
@@ -473,7 +490,7 bool QBarSeriesPrivate::append(QBarSet *set)
473 490 if (m_dataset) {
474 491 m_dataset->updateSeries(q); // this notifies legend
475 492 }
476 // emit restructuredBars(); // this notifies barchartitem
493 emit restructuredBars(); // this notifies barchartitem
477 494 return true;
478 495 }
479 496
@@ -489,7 +506,7 bool QBarSeriesPrivate::remove(QBarSet *set)
489 506 if (m_dataset) {
490 507 m_dataset->updateSeries(q); // this notifies legend
491 508 }
492 // emit restructuredBars(); // this notifies barchartitem
509 emit restructuredBars(); // this notifies barchartitem
493 510 return true;
494 511 }
495 512
@@ -514,7 +531,7 bool QBarSeriesPrivate::append(QList<QBarSet* > sets)
514 531 if (m_dataset) {
515 532 m_dataset->updateSeries(q); // this notifies legend
516 533 }
517 // emit restructuredBars(); // this notifies barchartitem
534 emit restructuredBars(); // this notifies barchartitem
518 535 return true;
519 536 }
520 537
@@ -534,7 +551,7 bool QBarSeriesPrivate::remove(QList<QBarSet* > sets)
534 551 if (m_dataset) {
535 552 m_dataset->updateSeries(q); // this notifies legend
536 553 }
537 // emit restructuredBars(); // this notifies barchartitem
554 emit restructuredBars(); // this notifies barchartitem
538 555 }
539 556 return setsRemoved;
540 557 }
@@ -45,6 +45,9 class QBarSeriesPrivate : public QAbstractSeriesPrivate
45 45 public:
46 46 QBarSeriesPrivate(QBarSeries *parent);
47 47 // TODO: refactor/remove private category stuff
48 void setCategories(QStringList categories);
49 void insertCategory(int index, const QString category);
50 void removeCategory(int index);
48 51 int categoryCount() const;
49 52 QStringList categories() const;
50 53
@@ -76,8 +79,8 public:
76 79 Q_SIGNALS:
77 80 void clicked(QBarSet *barset, int index);
78 81 void updatedBars();
79 // void restructuredBars();
80 // void categoriesUpdated();
82 void restructuredBars();
83 void categoriesUpdated();
81 84 void labelsVisibleChanged(bool visible);
82 85
83 86 private Q_SLOTS:
General Comments 0
You need to be logged in to leave comments. Login now