@@ -38,7 +38,6 BarChartItem::BarChartItem(QBarSeries *series, ChartPresenter *presenter) : | |||||
38 | { |
|
38 | { | |
39 | setFlag(ItemClipsChildrenToShape); |
|
39 | setFlag(ItemClipsChildrenToShape); | |
40 | connect(series->d_func(), SIGNAL(updatedBars()), this, SLOT(handleLayoutChanged())); |
|
40 | connect(series->d_func(), SIGNAL(updatedBars()), this, SLOT(handleLayoutChanged())); | |
41 | connect(series->d_func(), SIGNAL(restructuredBars()), this, SLOT(handleModelChanged())); |
|
|||
42 | connect(series->d_func(), SIGNAL(labelsVisibleChanged(bool)), this, SLOT(labelsVisibleChanged(bool))); |
|
41 | connect(series->d_func(), SIGNAL(labelsVisibleChanged(bool)), this, SLOT(labelsVisibleChanged(bool))); | |
43 | setZValue(ChartPresenter::BarSeriesZValue); |
|
42 | setZValue(ChartPresenter::BarSeriesZValue); | |
44 | dataChanged(); |
|
43 | dataChanged(); | |
@@ -168,12 +167,6 void BarChartItem::setLayout(const QVector<QRectF> &layout) | |||||
168 | } |
|
167 | } | |
169 | //handlers |
|
168 | //handlers | |
170 |
|
169 | |||
171 | void BarChartItem::handleModelChanged() |
|
|||
172 | { |
|
|||
173 | // dataChanged(); |
|
|||
174 | presenter()->resetAllElements(); |
|
|||
175 | } |
|
|||
176 |
|
||||
177 | void BarChartItem::handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY) |
|
170 | void BarChartItem::handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY) | |
178 | { |
|
171 | { | |
179 | m_domainMinX = minX; |
|
172 | m_domainMinX = minX; |
@@ -63,7 +63,6 public: | |||||
63 | QRectF geometry() const { return m_rect;} |
|
63 | QRectF geometry() const { return m_rect;} | |
64 |
|
64 | |||
65 | public Q_SLOTS: |
|
65 | public Q_SLOTS: | |
66 | void handleModelChanged(); |
|
|||
67 | void handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY); |
|
66 | void handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY); | |
68 | void handleGeometryChanged(const QRectF &size); |
|
67 | void handleGeometryChanged(const QRectF &size); | |
69 | void handleLayoutChanged(); |
|
68 | void handleLayoutChanged(); |
@@ -231,23 +231,6 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 |
|
||||
251 | int QBarSeriesPrivate::categoryCount() const |
|
234 | int QBarSeriesPrivate::categoryCount() const | |
252 | { |
|
235 | { | |
253 | if (m_categories.count() > 0) { |
|
236 | if (m_categories.count() > 0) { | |
@@ -490,7 +473,7 bool QBarSeriesPrivate::append(QBarSet *set) | |||||
490 | if (m_dataset) { |
|
473 | if (m_dataset) { | |
491 | m_dataset->updateSeries(q); // this notifies legend |
|
474 | m_dataset->updateSeries(q); // this notifies legend | |
492 | } |
|
475 | } | |
493 | emit restructuredBars(); // this notifies barchartitem |
|
476 | // emit restructuredBars(); // this notifies barchartitem | |
494 | return true; |
|
477 | return true; | |
495 | } |
|
478 | } | |
496 |
|
479 | |||
@@ -506,7 +489,7 bool QBarSeriesPrivate::remove(QBarSet *set) | |||||
506 | if (m_dataset) { |
|
489 | if (m_dataset) { | |
507 | m_dataset->updateSeries(q); // this notifies legend |
|
490 | m_dataset->updateSeries(q); // this notifies legend | |
508 | } |
|
491 | } | |
509 | emit restructuredBars(); // this notifies barchartitem |
|
492 | // emit restructuredBars(); // this notifies barchartitem | |
510 | return true; |
|
493 | return true; | |
511 | } |
|
494 | } | |
512 |
|
495 | |||
@@ -531,7 +514,7 bool QBarSeriesPrivate::append(QList<QBarSet* > sets) | |||||
531 | if (m_dataset) { |
|
514 | if (m_dataset) { | |
532 | m_dataset->updateSeries(q); // this notifies legend |
|
515 | m_dataset->updateSeries(q); // this notifies legend | |
533 | } |
|
516 | } | |
534 | emit restructuredBars(); // this notifies barchartitem |
|
517 | // emit restructuredBars(); // this notifies barchartitem | |
535 | return true; |
|
518 | return true; | |
536 | } |
|
519 | } | |
537 |
|
520 | |||
@@ -551,7 +534,7 bool QBarSeriesPrivate::remove(QList<QBarSet* > sets) | |||||
551 | if (m_dataset) { |
|
534 | if (m_dataset) { | |
552 | m_dataset->updateSeries(q); // this notifies legend |
|
535 | m_dataset->updateSeries(q); // this notifies legend | |
553 | } |
|
536 | } | |
554 | emit restructuredBars(); // this notifies barchartitem |
|
537 | // emit restructuredBars(); // this notifies barchartitem | |
555 | } |
|
538 | } | |
556 | return setsRemoved; |
|
539 | return setsRemoved; | |
557 | } |
|
540 | } |
@@ -45,9 +45,6 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); |
|
|||
51 | int categoryCount() const; |
|
48 | int categoryCount() const; | |
52 | QStringList categories() const; |
|
49 | QStringList categories() const; | |
53 |
|
50 | |||
@@ -79,8 +76,8 public: | |||||
79 | Q_SIGNALS: |
|
76 | Q_SIGNALS: | |
80 | void clicked(QBarSet *barset, int index); |
|
77 | void clicked(QBarSet *barset, int index); | |
81 | void updatedBars(); |
|
78 | void updatedBars(); | |
82 | void restructuredBars(); |
|
79 | // void restructuredBars(); | |
83 | void categoriesUpdated(); |
|
80 | // void categoriesUpdated(); | |
84 | void labelsVisibleChanged(bool visible); |
|
81 | void labelsVisibleChanged(bool visible); | |
85 |
|
82 | |||
86 | private Q_SLOTS: |
|
83 | private Q_SLOTS: |
General Comments 0
You need to be logged in to leave comments.
Login now