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

Binding loop when propagating the implicit height from Text to its parent item, while the size propagates downward

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.0
    • Fix Version/s: None
    • Component/s: Quick: Layouts
    • Labels:
      None

      Description

      When there is the hierarchy

      Control (or any of its subclasses from QtQuickControls2)

      a layout (ColumknLayout, RowLayout or GridLayout)

      and Text (or Label from QtQuickControls2)

      Item {
          width: 300
          implicitHeight: layout.implicitHeight
      
          ColumnLayout {
              id: layout
              anchors.fill:parent
              Text {
                  Layout.fillWidth: true
                  text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam purus lacus, cursus id fermentum vel"
                  wrapMode: Text.WordWrap
              }
          }
      }
      

       

      we have a binding loop on implicitHeight if the Control has a fixed width and height not set (default)

       

      This is a very common case in listviews, where one can have a Delegate as ListView delegate and a layout with various labels inside to show the model data, leading to views with visible layout problems.

        Attachments

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

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            notmart Marco Martin
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes