mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 14:55:03 -06:00
Fix number of extruders not being updated
This commit is contained in:
parent
038a5b5942
commit
b9d8b89113
1 changed files with 14 additions and 2 deletions
|
@ -285,18 +285,30 @@ Item
|
|||
optionModel: ListModel
|
||||
{
|
||||
id: extruderCountModel
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
extruderCountModel.clear()
|
||||
update()
|
||||
}
|
||||
|
||||
function update()
|
||||
{
|
||||
clear()
|
||||
for (var i = 1; i <= Cura.MachineManager.activeMachine.maxExtruderCount; i++)
|
||||
{
|
||||
// Use String as value. JavaScript only has Number. PropertyProvider.setPropertyValue()
|
||||
// takes a QVariant as value, and Number gets translated into a float. This will cause problem
|
||||
// for integer settings such as "Number of Extruders".
|
||||
extruderCountModel.append({ text: String(i), value: String(i) })
|
||||
append({ text: String(i), value: String(i) })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onGlobalContainerChanged: extruderCountModel.update()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue