fix initialisation of textfield params
This commit is contained in:
parent
72d4780f75
commit
4740c3f67b
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user