Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
6.0
Description
A readonly binding cannot be broken. The value of the property will be exclusively modified by the binding evaluation engine. It will act as an guard against broken bindings.
Possible Syntax => Qt.readonlyBinding(..)
property int a: 12 property int b: a Component.onCompleted: { console.log("Value of b: ",b); // Value of b: 12 b = Qt.readonlyBinding( () => a+20 ); b = 50; // TypeError: Cannot assign to readonly property "b" console.log("Value of b: ",b); // Value of b: 32 myComponent.createObject(root,{ "height": Qt.readonlyBinding( () => root.height/10 ), "width": Qt.readonlyBinding( () => root.width/10 ) }); }