##// 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 int QBarSeriesPrivate::categoryCount() const
251 int QBarSeriesPrivate::categoryCount() const
235 {
252 {
236 if (m_categories.count() > 0) {
253 if (m_categories.count() > 0) {
@@ -473,7 +490,7 bool QBarSeriesPrivate::append(QBarSet *set)
473 if (m_dataset) {
490 if (m_dataset) {
474 m_dataset->updateSeries(q); // this notifies legend
491 m_dataset->updateSeries(q); // this notifies legend
475 }
492 }
476 // emit restructuredBars(); // this notifies barchartitem
493 emit restructuredBars(); // this notifies barchartitem
477 return true;
494 return true;
478 }
495 }
479
496
@@ -489,7 +506,7 bool QBarSeriesPrivate::remove(QBarSet *set)
489 if (m_dataset) {
506 if (m_dataset) {
490 m_dataset->updateSeries(q); // this notifies legend
507 m_dataset->updateSeries(q); // this notifies legend
491 }
508 }
492 // emit restructuredBars(); // this notifies barchartitem
509 emit restructuredBars(); // this notifies barchartitem
493 return true;
510 return true;
494 }
511 }
495
512
@@ -514,7 +531,7 bool QBarSeriesPrivate::append(QList<QBarSet* > sets)
514 if (m_dataset) {
531 if (m_dataset) {
515 m_dataset->updateSeries(q); // this notifies legend
532 m_dataset->updateSeries(q); // this notifies legend
516 }
533 }
517 // emit restructuredBars(); // this notifies barchartitem
534 emit restructuredBars(); // this notifies barchartitem
518 return true;
535 return true;
519 }
536 }
520
537
@@ -534,7 +551,7 bool QBarSeriesPrivate::remove(QList<QBarSet* > sets)
534 if (m_dataset) {
551 if (m_dataset) {
535 m_dataset->updateSeries(q); // this notifies legend
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 return setsRemoved;
556 return setsRemoved;
540 }
557 }
@@ -45,6 +45,9 class QBarSeriesPrivate : public QAbstractSeriesPrivate
45 public:
45 public:
46 QBarSeriesPrivate(QBarSeries *parent);
46 QBarSeriesPrivate(QBarSeries *parent);
47 // TODO: refactor/remove private category stuff
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 int categoryCount() const;
51 int categoryCount() const;
49 QStringList categories() const;
52 QStringList categories() const;
50
53
@@ -76,8 +79,8 public:
76 Q_SIGNALS:
79 Q_SIGNALS:
77 void clicked(QBarSet *barset, int index);
80 void clicked(QBarSet *barset, int index);
78 void updatedBars();
81 void updatedBars();
79 // void restructuredBars();
82 void restructuredBars();
80 // void categoriesUpdated();
83 void categoriesUpdated();
81 void labelsVisibleChanged(bool visible);
84 void labelsVisibleChanged(bool visible);
82
85
83 private Q_SLOTS:
86 private Q_SLOTS:
General Comments 0
You need to be logged in to leave comments. Login now