1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
import QtQuick Item { id: root property bool toggle: true property bool forceEnable: false Item { id: item1 property int i } Item { id: item2 } Binding { target: root.toggle ? item1 : item2 when: root.forceEnable || (root.toggle ? item1 : item2).hasOwnProperty("i") property: "i" value: 42 } }