mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-19 20:57:49 -06:00
Make SettingComboBox work (mostly) properly
=
This commit is contained in:
parent
06432c3b0b
commit
f5e97c5001
1 changed files with 11 additions and 16 deletions
|
@ -13,6 +13,8 @@ SettingItem
|
||||||
|
|
||||||
contents: ComboBox
|
contents: ComboBox
|
||||||
{
|
{
|
||||||
|
id: control
|
||||||
|
|
||||||
model: definition.options
|
model: definition.options
|
||||||
textRole: "value";
|
textRole: "value";
|
||||||
|
|
||||||
|
@ -83,32 +85,25 @@ SettingItem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
onActivated: {
|
|
||||||
valueChanged(options.getItem(index).value);
|
|
||||||
}
|
|
||||||
|
|
||||||
onModelChanged: {
|
onActivated: provider.setPropertyValue("value", definition.options[index].key)
|
||||||
updateCurrentIndex();
|
onModelChanged: updateCurrentIndex();
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Connections
|
||||||
parent.parent.valueChanged.connect(updateCurrentIndex)
|
{
|
||||||
|
target: provider
|
||||||
|
onPropertiesChanged: control.updateCurrentIndex()
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateCurrentIndex() {
|
function updateCurrentIndex() {
|
||||||
if (!options) {
|
for(var i = 0; i < definition.options.length; ++i) {
|
||||||
return;
|
if(definition.options[i].key == provider.properties.value) {
|
||||||
}
|
|
||||||
|
|
||||||
for(var i = 0; i < options.rowCount(); ++i) {
|
|
||||||
if(options.getItem(i).value == value) {
|
|
||||||
currentIndex = i;
|
currentIndex = i;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
currentIndex = -1;
|
currentIndex = -1;
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue