Strange binding error in Flow element
Hi,
I receive a strange binding error that I don't understand. The output seems to work as expected. By commenting out unnessecary stuff I've tracked it down to this minimal example:
Code:
Flow {
height: visible ? childrenRect.height : 0
Repeater {
model: [my model]
delegate: CheckBox {
}
}
}
That gives me
Quote:
QML Flow: Binding loop detected for property "height"
Please note: if I change height property to
Code:
height: childrenRect.height
(thus removing the ternary operator), the error does not occur. That especially leaves me puzzled.
Any ideas?
Re: Strange binding error in Flow element
Its seems that you have, just as the error states, a recursive property binding.
That means, that one height property effects the other, and the other is bound to the first, causing an infinite loop of setting values between the to height properties.
Re: Strange binding error in Flow element
I don't know how this can be a binding error, but of course you are right. Actually, the solution is quite simple after all: I define a bool property in the parent item and let both visible and height reference to it:
Code:
property bool flowVisible: true
Flow {
visible: flowVisible
height: flowVisible? childrenRect.height : 0
Repeater {
model: [my model]
delegate: CheckBox {
}
}
}
Thanks!