mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
[ui] AttributeEditor: don't instantiate slider if no range is defined
This commit is contained in:
parent
fc8a3f5f0b
commit
ca712ef2aa
1 changed files with 15 additions and 12 deletions
|
@ -202,16 +202,18 @@ RowLayout {
|
||||||
}
|
}
|
||||||
implicitWidth: 70
|
implicitWidth: 70
|
||||||
enabled: root.editable
|
enabled: root.editable
|
||||||
text: s.pressed ? s.value : attribute.value
|
text: slider.active && slider.item.pressed ? slider.value : attribute.value
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
validator: attribute.type == "FloatParam" ? doubleValidator : intValidator
|
validator: attribute.type == "FloatParam" ? doubleValidator : intValidator
|
||||||
onEditingFinished: setTextFieldAttribute(text)
|
onEditingFinished: setTextFieldAttribute(text)
|
||||||
onAccepted: setTextFieldAttribute(text)
|
onAccepted: setTextFieldAttribute(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
Slider {
|
Loader {
|
||||||
id: s
|
id: slider
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
active: attribute.desc.range != undefined
|
||||||
|
sourceComponent: Slider {
|
||||||
enabled: root.editable
|
enabled: root.editable
|
||||||
value: attribute.value
|
value: attribute.value
|
||||||
from: attribute.desc.range[0]
|
from: attribute.desc.range[0]
|
||||||
|
@ -224,6 +226,7 @@ RowLayout {
|
||||||
_reconstruction.setAttribute(attribute, value)
|
_reconstruction.setAttribute(attribute, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue