diff --git a/src/widgets/pieview.cpp b/src/widgets/pieview.cpp index c8867426..74a711eb 100644 --- a/src/widgets/pieview.cpp +++ b/src/widgets/pieview.cpp @@ -65,6 +65,14 @@ PieView::PieView(QWidget *parent) rubberBand = 0; } +void PieView::reset() +{ + validItems = 0; + totalValue = 0.0; + + QAbstractItemView::reset(); +} + void PieView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &) diff --git a/src/widgets/pieview.h b/src/widgets/pieview.h index 435d06d5..b99434cb 100644 --- a/src/widgets/pieview.h +++ b/src/widgets/pieview.h @@ -55,11 +55,14 @@ public: void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible); QModelIndex indexAt(const QPoint &point) const; +public slots: + void reset() override; + protected slots: void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, - const QVector &roles = QVector()); - void rowsInserted(const QModelIndex &parent, int start, int end); - void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + const QVector &roles = QVector()) override; + void rowsInserted(const QModelIndex &parent, int start, int end) override; + void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override; protected: bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event);