[ui] AttributeEditor: set attribute when edited TextField is destroyed

ensure attribute is correctly set when the AttributeItemDelegate is abruptly destroyed (e.g: when another node is selected)
This commit is contained in:
Yann Lanthony 2018-07-27 18:05:51 +02:00
parent c3464fa4e8
commit 754a4360a3

View file

@ -142,6 +142,10 @@ RowLayout {
setTextFieldAttribute(text)
root.forceActiveFocus()
}
Component.onDestruction: {
if(activeFocus)
setTextFieldAttribute(text)
}
DropArea {
enabled: root.editable
anchors.fill: parent
@ -209,6 +213,10 @@ RowLayout {
validator: attribute.type == "FloatParam" ? doubleValidator : intValidator
onEditingFinished: setTextFieldAttribute(text)
onAccepted: setTextFieldAttribute(text)
Component.onDestruction: {
if(activeFocus)
setTextFieldAttribute(text)
}
}
Loader {