mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-24 11:21:14 -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
|
|
@ -106,7 +106,7 @@ Item
|
|||
var availableMin = -1
|
||||
var availableMax = -1
|
||||
|
||||
for (var i = 0; i < Cura.QualityProfilesDropDownMenuModel.rowCount(); i++)
|
||||
for (var i = 0; i < Cura.QualityProfilesDropDownMenuModel.count; i++)
|
||||
{
|
||||
var qualityItem = Cura.QualityProfilesDropDownMenuModel.getItem(i)
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ Item
|
|||
qualityModel.existingQualityProfile = 0
|
||||
|
||||
// check, the ticks count cannot be less than zero
|
||||
qualityModel.totalTicks = Math.max(0, Cura.QualityProfilesDropDownMenuModel.rowCount() - 1)
|
||||
qualityModel.totalTicks = Math.max(0, Cura.QualityProfilesDropDownMenuModel.count - 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1156,7 +1156,7 @@ Item
|
|||
function populateExtruderModel()
|
||||
{
|
||||
extruderModel.clear();
|
||||
for(var extruderNumber = 0; extruderNumber < extruders.rowCount() ; extruderNumber++)
|
||||
for(var extruderNumber = 0; extruderNumber < extruders.count; extruderNumber++)
|
||||
{
|
||||
extruderModel.append({
|
||||
text: extruders.getItem(extruderNumber).name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue