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

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.14.0
    • Quick: Layouts
    • 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

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              notmart Marco Martin
              Votes:
              9 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes