Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-39921

Wrong detection of binding loop

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.3.1
    • None

    Description

      It's looks like regression - when I run my QML code under Qt 5.3.1 I've received this error message:
      >> BindLoopTest.qml:25:5: QML Rectangle: Binding loop detected for property "x"
      But in older Qt versions it works fine. And I think that it is correct QML code without loops.

      In example below commented code will cause wrong detection of binding loop.

      import QtQuick 2.2
      
      Rectangle {
          width: 360; height: 360
      
          Flickable {
              id: rootDetailsRect
      
              // In Qt 5.3.1 says : Binding loop detected for property "x"
      //        anchors {
      //            top: parent.bottom
      //            bottom: parent.bottom
      //        }
      //        width: parent.width
      
              // Works ok in Qt 5.3.1, 5.3.0, 5.2.0 
              anchors {
                  top: parent.bottom
                  bottom: parent.bottom
                  left: parent.left
                  right: parent.right
              }
      
              contentWidth: mainColumn.width
              contentHeight: mainColumn.height
      
              Column {
                  id: mainColumn
                  spacing: 4
                  width: childrenRect.width
              }
          } // Flickable
      
          Rectangle {
              id: scrollbar
      
              anchors.bottom: rootDetailsRect.bottom
              x: rootDetailsRect.visibleArea.xPosition * rootDetailsRect.width
              height: 4
              width: rootDetailsRect.visibleArea.widthRatio * rootDetailsRect.width
              color: "lightgray"
          }
      }
      

      P.S. it is only example - in my project I do not use
      anchor.top: parent
      becase of course I can use "anchors.fill: parent" instead.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            shausman Simon Hausmann
            qtros Roman Shchekin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes