Important: Please read the Qt Code of Conduct -

Binding loop detected for property "width" when I add 20 to width

  • Hi,
    When I do:
    @width : childrenRect.width + 20@

    I get the
    @Binding loop detected for property "width"@

    Without the "+ 20" no error.
    Still, the app works OK: the 20pix do get added to the width correctly.
    Should I ignore the error message?

  • I believe you get this error because childrenRect.width changes when width changes. So width = childrenRect.width + 20 -> childrenRect.width changes because width changes -> width changes because childrenRect.width changes etc.

    Best not to ignore this.

  • Thanks, but
    childrenRect.width can (should) not change because it is not dependant on its parents width.
    If it were then we would have a binding loop.

Log in to reply