1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import QtQuick 2.4
Item {
width: 200
height: 200
Rectangle {
id: rect1
width: 100
height: 100
color: "red"
property var cardWidth: {
console.log("Evaluating cardWidth width");
return parent.width >= 200 ? 100 : 50;
}
}
Rectangle {
id: rect2
width: {
console.log("Evaluating rect2 width");
return rect1.cardWidth >= 100 ? 50 : 25;
}
height: 50
color: "blue"
}
}
|