Hi, this simple code generates “QML Rectangle: Binding loop detected for property “height”“ warning/error when clicked and Rectangle becomes visible. I really do not see that there is a binding loop.
The warning/error is not printed if Rectangle initial property expanded is true, so this object has height at the beginning.
Is this QML bug or there are some under the hood strange initializations, when size is 0 at beginning?
Thank you
Item {
width: 400
height: 400
Rectangle {
id: subOptionList
property bool expanded: false
height: expanded ? childrenRect.height : 0
clip: true
width: parent.width
Rectangle {
border.color: "red"
width: parent.width
height: 20
}
}
MouseArea {
anchors.fill: parent
onClicked: {
subOptionList.expanded = !subOptionList.expanded
}
}
}
↧








