Cleanup: implement proper Qt-model semantics in WeightInfoModel

- Use a beginResetModel()/endResetModel() pair instead of distinct
addRows / removeRows pairs.

- Reuse the update function in the constructor().

- Let "rows" be the number of rows, not the number of rows minus one.

- Remove updateInfo() function as it does the same as update().

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-04-27 16:53:13 +02:00 committed by Dirk Hohndel
parent 36d8dcc3bf
commit cab0147093
3 changed files with 8 additions and 39 deletions

View file

@ -22,7 +22,6 @@ public:
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
void clear();
void update();
void updateInfo();
private:
int rows;