|
|
@ -6,22 +6,37 @@ Item |
|
|
|
id: editRoot |
|
|
|
property string value |
|
|
|
property string defaultValue |
|
|
|
property alias readOnly: !boolCombo.enabled |
|
|
|
property bool readOnly: !boolCombo.enabled |
|
|
|
height: 20 |
|
|
|
width: 150 |
|
|
|
|
|
|
|
onReadOnlyChanged: { |
|
|
|
boolCombo.enabled = !readOnly; |
|
|
|
} |
|
|
|
|
|
|
|
function init() |
|
|
|
{ |
|
|
|
value = value === true ? "1" : value |
|
|
|
value = value === false ? "0" : value; |
|
|
|
value = value === "true" ? "1" : value |
|
|
|
value = value === "false" ? "0" : value; |
|
|
|
|
|
|
|
if (value === "") |
|
|
|
boolCombo.currentIndex = parseInt(defaultValue); |
|
|
|
else |
|
|
|
boolCombo.currentIndex = parseInt(value); |
|
|
|
boolCombo.enabled = !readOnly; |
|
|
|
} |
|
|
|
|
|
|
|
Rectangle { |
|
|
|
anchors.fill: parent |
|
|
|
ComboBox |
|
|
|
{ |
|
|
|
property bool inited: false |
|
|
|
property bool inited; |
|
|
|
Component.onCompleted: |
|
|
|
{ |
|
|
|
if (value === "") |
|
|
|
currentIndex = parseInt(defaultValue); |
|
|
|
else |
|
|
|
currentIndex = parseInt(value); |
|
|
|
inited = true |
|
|
|
init(); |
|
|
|
inited = true; |
|
|
|
} |
|
|
|
|
|
|
|
id: boolCombo |
|
|
|