Skip to content

Instantly share code, notes, and snippets.

@snyh
Created December 6, 2013 08:05
Show Gist options
  • Save snyh/7820181 to your computer and use it in GitHub Desktop.
Save snyh/7820181 to your computer and use it in GitHub Desktop.
qml property twoway sync.
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