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

View file

@ -15,13 +15,8 @@ PropItem {
Global { id: global } Global { id: global }
id: root id: root
property alias valueVar : valueCombo.currentIndex
property alias enums : valueCombo.model property alias enums : valueCombo.model
Component.onCompleted: {
valueVar = root.valueVarGetter();
}
PropComboBox { PropComboBox {
id: valueCombo id: valueCombo
@ -33,6 +28,6 @@ PropItem {
height: global.slimHeight height: global.slimHeight
currentIndex: root.valueVarGetter() 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" // value is accessed through the "valueVarSetter" and "valueVarGetter"
// By default, these just go get or set the value from the object[property] // 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 defaultSet(value) { root.object[root.property] = value; }
// function defaultSetReadOnly(value) { log ( "read only " + property + ", NOT setting to " + value); } // function defaultSetReadOnly(value) { log ( "read only " + property + ", NOT setting to " + value); }
// function defaultSetReadOnly(value) {} // function defaultSetReadOnly(value) {}

View file

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

View file

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

View file

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

View file

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