mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 14:34:01 -06: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
|
@ -57,7 +57,7 @@ Item
|
|||
var currentItemId = base.currentItem == null ? "" : base.currentItem.root_material_id
|
||||
search_root_id = currentItemId
|
||||
}
|
||||
for (var material_idx = 0; material_idx < genericMaterialsModel.rowCount(); material_idx++)
|
||||
for (var material_idx = 0; material_idx < genericMaterialsModel.count; material_idx++)
|
||||
{
|
||||
var material = genericMaterialsModel.getItem(material_idx)
|
||||
if (material.root_material_id == search_root_id)
|
||||
|
@ -72,15 +72,15 @@ Item
|
|||
return true
|
||||
}
|
||||
}
|
||||
for (var brand_idx = 0; brand_idx < materialsModel.rowCount(); brand_idx++)
|
||||
for (var brand_idx = 0; brand_idx < materialsModel.count; brand_idx++)
|
||||
{
|
||||
var brand = materialsModel.getItem(brand_idx)
|
||||
var types_model = brand.material_types
|
||||
for (var type_idx = 0; type_idx < types_model.rowCount(); type_idx++)
|
||||
for (var type_idx = 0; type_idx < types_model.count; type_idx++)
|
||||
{
|
||||
var type = types_model.getItem(type_idx)
|
||||
var colors_model = type.colors
|
||||
for (var material_idx = 0; material_idx < colors_model.rowCount(); material_idx++)
|
||||
for (var material_idx = 0; material_idx < colors_model.count; material_idx++)
|
||||
{
|
||||
var material = colors_model.getItem(material_idx)
|
||||
if (material.root_material_id == search_root_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue