fix initialisation of textfield params

This commit is contained in:
Michael Zanetti 2018-12-17 13:41:14 +01:00
parent 72d4780f75
commit 4740c3f67b

View File

@ -10,7 +10,7 @@ ItemDelegate {
property ParamType paramType: null
property alias value: d.value
property var param: Param {
property Param param: Param {
id: d
paramTypeId: paramType.id
value: paramType.defaultValue
@ -163,10 +163,19 @@ ItemDelegate {
Component {
id: textFieldComponent
TextField {
text: root.param.value
text: root.param.value !== undefined
? root.param.value
: root.paramType.defaultValue
? root.paramType.defaultValue
: ""
onEditingFinished: {
root.param.value = text
}
Component.onCompleted: {
if (root.param.value === undefined) {
root.param.value = text;
}
}
}
}