mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-14 08:48:36 +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;
|
||||
}
|
||||
|
||||
void PieView::reset()
|
||||
{
|
||||
validItems = 0;
|
||||
totalValue = 0.0;
|
||||
|
||||
QAbstractItemView::reset();
|
||||
}
|
||||
|
||||
void PieView::dataChanged(const QModelIndex &topLeft,
|
||||
const QModelIndex &bottomRight,
|
||||
const QVector<int> &)
|
||||
|
@ -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<int> &roles = QVector<int>());
|
||||
void rowsInserted(const QModelIndex &parent, int start, int end);
|
||||
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
|
||||
const QVector<int> &roles = QVector<int>()) 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);
|
||||
|
Loading…
Reference in New Issue
Block a user