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

binding loop with any Control and wrapping text

    XMLWordPrintable

    Details

      Description

      When there is any control that as mainItem has a layout (RowLayout, GridLayout, ColumnLayout) in which there is a Label that has word wrap on, if the control implicitHeight is based on contentItem's implicitHeight there will always be a binding loop

      note that most styles do indeedbase the control implicit size from contentItem, so it's likely to be a problem for any standard control

       

      Example:

      import QtQuick 2.12
      import QtQuick.Window 2.3
      import QtQuick.Controls 2.5
      import QtQuick.Layouts 1.12
      
      ApplicationWindow {
          id: mainWindow
          visible: true
      
          Control {
              implicitWidth: 600
              implicitHeight: lay.implicitHeight
              contentItem: RowLayout {
                  id: lay
      
                  onImplicitHeightChanged: print("layout implicitHeight "+implicitHeight)
      
                  Label {
                      onImplicitHeightChanged: print("label implicitHeight "+implicitHeight)
                      Layout.fillWidth: true
                      wrapMode: Text.WordWrap
                      text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id risus id augue euismod accumsan. Lorem ipsum dolor sit amet, "
                          + "consectetur adipiscing elit. Nullam id risus id augue euismod accumsan.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id risus id augue euismod accumsan."
      
                  }
              }
          }
      }
      

        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:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes