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

QML Text's implicit size is not correct for an item with fixed size

    XMLWordPrintable

Details

    • All

    Description

      QML Text's implicit size is not correct for an item with fixed size.

      Code sample:

      import QtQuick
      import QtQuick.Window
      
      Window {
          width: 900
          height: 480
          visible: true
      
          Text {
              width: 100
              height: 40
      
              text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer at ante dui Curabitur ante est, pulvinar quis adipiscing a, iaculis id ipsum."
              wrapMode: Text.Wrap
              elide: Text.ElideRight
      
              Rectangle {
                  width: parent.implicitWidth
                  height: parent.implicitHeight
                  color: 'red'
                  opacity: 0.5
              }
          }
      }
      

      Actual result:

      Expected result:

      Attachments

        1. image-2022-09-23-15-06-49-062.png
          9 kB
          Vladimir Belyavsky
        2. image-2022-09-23-15-06-51-278.png
          9 kB
          Vladimir Belyavsky
        3. image-2022-09-23-15-08-03-731.png
          8 kB
          Vladimir Belyavsky
        4. image-2022-09-23-20-32-27-424.png
          8 kB
          Vladimir Belyavsky
        5. screenshot-1.png
          10 kB
          Vladimir Belyavsky

        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
              studiosus Vladimir Belyavsky
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes