mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 08:43:16 +08:00
Fix errors in SettingOptionalExtruder.qml
CURA-6015
This commit is contained in:
parent
d879cab91a
commit
8021c8e449
@ -12,17 +12,24 @@ SettingItem
|
||||
id: base
|
||||
property var focusItem: control
|
||||
|
||||
// Somehow if we directory set control.model to CuraApplication.getExtrudersModelWithOptional()
|
||||
// and in the Connections.onModelChanged use control.model as a reference, it will complain about
|
||||
// non-existing properties such as "onModelChanged" and "getItem". I guess if we access the model
|
||||
// via "control.model", it gives back a generic/abstract model instance. To avoid this, we add
|
||||
// this extra property to keep the ExtrudersModel and use this in the rest of the code.
|
||||
property var extrudersWithOptionalModel: CuraApplication.getExtrudersModelWithOptional()
|
||||
|
||||
contents: ComboBox
|
||||
{
|
||||
id: control
|
||||
anchors.fill: parent
|
||||
|
||||
model: CuraApplication.getExtrudersModelWithOptional()
|
||||
model: base.extrudersWithOptionalModel
|
||||
|
||||
Connections
|
||||
{
|
||||
target: model
|
||||
onModelChanged: control.color = model.getItem(control.currentIndex).color
|
||||
target: base.extrudersWithOptionalModel
|
||||
onModelChanged: control.color = base.extrudersWithOptionalModel.getItem(control.currentIndex).color
|
||||
}
|
||||
|
||||
textRole: "name"
|
||||
|
Loading…
x
Reference in New Issue
Block a user