mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-21 14:16:08 +00:00
PieView: Add reset function
On treeWidget->clear() non of the the existing functions got called so the total doubled with every refresh
This commit is contained in:
parent
06e82c8421
commit
d45c253f9f
@ -65,6 +65,14 @@ PieView::PieView(QWidget *parent)
|
|||||||
rubberBand = 0;
|
rubberBand = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PieView::reset()
|
||||||
|
{
|
||||||
|
validItems = 0;
|
||||||
|
totalValue = 0.0;
|
||||||
|
|
||||||
|
QAbstractItemView::reset();
|
||||||
|
}
|
||||||
|
|
||||||
void PieView::dataChanged(const QModelIndex &topLeft,
|
void PieView::dataChanged(const QModelIndex &topLeft,
|
||||||
const QModelIndex &bottomRight,
|
const QModelIndex &bottomRight,
|
||||||
const QVector<int> &)
|
const QVector<int> &)
|
||||||
|
@ -55,11 +55,14 @@ public:
|
|||||||
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible);
|
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible);
|
||||||
QModelIndex indexAt(const QPoint &point) const;
|
QModelIndex indexAt(const QPoint &point) const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void reset() override;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
||||||
const QVector<int> &roles = QVector<int>());
|
const QVector<int> &roles = QVector<int>()) override;
|
||||||
void rowsInserted(const QModelIndex &parent, int start, int end);
|
void rowsInserted(const QModelIndex &parent, int start, int end) override;
|
||||||
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
|
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event);
|
bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event);
|
||||||
|
Loading…
Reference in New Issue
Block a user