Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problems with QtQuick and sizing

Problems with QtQuick and sizing

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    topse
    wrote on last edited by
    #1

    Hi people,
    sorry - I have a feeling as if this is trivial... but I am really stuck on this:

    @ Item { <- QML Item: Binding loop detected for property "width"
    id: contentItem
    anchors.left: parent.left
    width: childrenRect.width
    height: childrenRect.height
    }@

    Same message for height on same line...

    This is of course an excerpt of a bigger file -- ao I question myself: is the error message pointing to the right place or does it mean something else? Am I not allowed to define height and width for an Item from the children?

    Thanks for advice -- also for where I can read about it :-/

    The Captain

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      A binding loop means you have circular dependencies. For example,

      @
      Rectangle {
      id: outerRect
      width: innerRect.width

      Rectangle {
          id: innerRect
          width: outerRect.width
      }
      

      }
      @

      If you want to calculate the width of outerRect, you first need to calculate the width of innerRect. But, if you want to calculate the width of innerRect, you first need to calculate the width of outerRect. Thus, it is impossible to find the widths of either rectangle.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • T Offline
        T Offline
        topse
        wrote on last edited by
        #3

        Hi,
        thanks for the clarification... As far as I see, "width: childrenRect.width" should not be circular?

        Thanks again,
        Tobias

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          You're welcome :)

          [quote author="topse" date="1406810154"]As far as I see, "width: childrenRect.width" should not be circular?[/quote]By itself, it's not circular. However, do any of your children's widths depend on the parent's width? How are each of your children's widths calculated?

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • T Offline
            T Offline
            topse
            wrote on last edited by
            #5

            Thanks again ... I will check it... what a pitty that the debugger does not give more information :-/

            Tobias

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved