mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 22:13:58 -06:00
Fix errors in SettingOptionalExtruder.qml
CURA-6015
This commit is contained in:
parent
d879cab91a
commit
8021c8e449
1 changed files with 10 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue