Use ListModel.count instead of rowCount

The .count property properly updates when the model is changed.

Contributes to issue CURA-5876.
This commit is contained in:
Ghostkeeper 2018-12-03 11:13:26 +01:00
parent db05d7853a
commit f3af5a72ad
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
14 changed files with 49 additions and 36 deletions

View file

@ -65,7 +65,7 @@ Item
style: UM.Theme.styles.toolbar_button
property bool isFirstElement: toolsModel.getItem(0).id == model.id
property bool isLastElement: toolsModel.getItem(toolsModel.rowCount() - 1).id == model.id
property bool isLastElement: toolsModel.getItem(toolsModel.count - 1).id == model.id
onCheckedChanged:
{