mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-23 19:01:05 -07:00
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:
parent
db05d7853a
commit
f3af5a72ad
14 changed files with 49 additions and 36 deletions
|
|
@ -34,7 +34,7 @@ Menu
|
|||
MenuSeparator
|
||||
{
|
||||
id: customSeparator
|
||||
visible: Cura.CustomQualityProfilesDropDownMenuModel.rowCount > 0
|
||||
visible: Cura.CustomQualityProfilesDropDownMenuModel.count > 0
|
||||
}
|
||||
|
||||
Instantiator
|
||||
|
|
@ -45,7 +45,7 @@ Menu
|
|||
Connections
|
||||
{
|
||||
target: Cura.CustomQualityProfilesDropDownMenuModel
|
||||
onModelReset: customSeparator.visible = Cura.CustomQualityProfilesDropDownMenuModel.rowCount() > 0
|
||||
onModelReset: customSeparator.visible = Cura.CustomQualityProfilesDropDownMenuModel.count > 0
|
||||
}
|
||||
|
||||
MenuItem
|
||||
|
|
@ -59,12 +59,12 @@ Menu
|
|||
|
||||
onObjectAdded:
|
||||
{
|
||||
customSeparator.visible = model.rowCount() > 0;
|
||||
customSeparator.visible = model.count > 0;
|
||||
menu.insertItem(index, object);
|
||||
}
|
||||
onObjectRemoved:
|
||||
{
|
||||
customSeparator.visible = model.rowCount() > 0;
|
||||
customSeparator.visible = model.count > 0;
|
||||
menu.removeItem(object);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue