Created
December 6, 2013 08:05
-
-
Save snyh/7820181 to your computer and use it in GitHub Desktop.
qml property twoway sync.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
import QtQuick.Controls 1.0 | |
Column { | |
CheckBox { | |
id:a1 | |
text:"A1" | |
Binding { target :a2; property: "checked"; value:a1.checked } | |
} | |
CheckBox { | |
id:a2 | |
Binding { target :a1; property: "checked"; value:a2.checked } | |
text:"A2" | |
} | |
Text { | |
text:"A1:" + a1.checked + " A2:" + a2.checked + "---------------------------" | |
} | |
//this is failed sync | |
CheckBox { | |
id:b1 | |
text : "B1" | |
checked: b2.checked | |
} | |
CheckBox { | |
id:b2 | |
text : "B2" | |
checked: b1.checked | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment