Merge PR #89: Fix initialisation of textfield params

This commit is contained in:
Jenkins 2018-12-18 01:04:26 +01:00
commit 04b613b73c

View File

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