mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 16:29:01 +08:00
Fix number of extruders not being updated
This commit is contained in:
parent
038a5b5942
commit
b9d8b89113
@ -285,18 +285,30 @@ Item
|
|||||||
optionModel: ListModel
|
optionModel: ListModel
|
||||||
{
|
{
|
||||||
id: extruderCountModel
|
id: extruderCountModel
|
||||||
|
|
||||||
Component.onCompleted:
|
Component.onCompleted:
|
||||||
{
|
{
|
||||||
extruderCountModel.clear()
|
update()
|
||||||
|
}
|
||||||
|
|
||||||
|
function update()
|
||||||
|
{
|
||||||
|
clear()
|
||||||
for (var i = 1; i <= Cura.MachineManager.activeMachine.maxExtruderCount; i++)
|
for (var i = 1; i <= Cura.MachineManager.activeMachine.maxExtruderCount; i++)
|
||||||
{
|
{
|
||||||
// Use String as value. JavaScript only has Number. PropertyProvider.setPropertyValue()
|
// 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
|
// takes a QVariant as value, and Number gets translated into a float. This will cause problem
|
||||||
// for integer settings such as "Number of Extruders".
|
// 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…
x
Reference in New Issue
Block a user