fixing the broken binding dependency for the propitems

This commit is contained in:
Sam Gateau 2019-06-05 00:33:44 -07:00
parent ba30892c0e
commit 34bae25d0e
7 changed files with 14 additions and 16 deletions

View file

@ -14,12 +14,6 @@ PropItem {
Global { id: global }
id: root
property alias valueVar : checkboxControl.checked
Component.onCompleted: {
valueVar = root.valueVarGetter();
}
PropCheckBox {
id: checkboxControl
@ -27,6 +21,7 @@ PropItem {
anchors.verticalCenter: root.verticalCenter
width: root.width * global.valueAreaWidthScale
checked: root.valueVarGetter();
onCheckedChanged: { root.valueVarSetter(checked); }
}
}

View file

@ -15,13 +15,8 @@ PropItem {
Global { id: global }
id: root
property alias valueVar : valueCombo.currentIndex
property alias enums : valueCombo.model
Component.onCompleted: {
valueVar = root.valueVarGetter();
}
PropComboBox {
id: valueCombo
@ -33,6 +28,6 @@ PropItem {
height: global.slimHeight
currentIndex: root.valueVarGetter()
onCurrentIndexChanged: { root.valueVarSetter(currentIndex); }
onCurrentIndexChanged: root.valueVarSetter(currentIndex)
}
}

View file

@ -23,7 +23,7 @@ Item {
// value is accessed through the "valueVarSetter" and "valueVarGetter"
// By default, these just go get or set the value from the object[property]
//
function defaultGet() { return root.object[root.property]; }
function defaultGet() { var v = root.object[root.property]; return v; }
function defaultSet(value) { root.object[root.property] = value; }
// function defaultSetReadOnly(value) { log ( "read only " + property + ", NOT setting to " + value); }
// function defaultSetReadOnly(value) {}

View file

@ -32,6 +32,13 @@ PropItem {
valueVar = root.valueVarGetter();
}
Connections
{
target: obj;
onValueChanged: console.log('changed');
}
PropLabel {
id: valueLabel
enabled: root.showValue

View file

@ -29,7 +29,7 @@ Column {
label: "Debug Buffer"
object: config
property: "mode"
valueVar: 0
// valueVar: 0
enums: [
"Off",
"Depth",

View file

@ -32,6 +32,7 @@ Column {
}
Prop.PropEnum {
id: refreshrateProfileControl
label: "Refresh Rate Profile"
object: Performance
property: "refreshRateProfile"

View file

@ -50,7 +50,7 @@ Rectangle {
}
}
}
/* Prop.PropFolderPanel {
Prop.PropFolderPanel {
label: "Platform"
panelFrameData: Component {
Platform {
@ -58,7 +58,7 @@ Rectangle {
anchors.right: parent.right
}
}
}*/
}
}
}
}