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

Text layout is broken if it contains inline images and eliding is used

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2, 6.2.4, 6.3.2, 6.4.1
    • None
    • Windows 10, MSVC 2019
    • All

    Description

      Text layout is broken if it contains inline images and eliding is used

      import QtQuick 2.15
      import QtQuick.Window 2.15
      
      Window {
          width: 640
          height: 480
      
          visible: true
      
          readonly property string smile: "<img src='qrc:/(smile).png' width='18' height='18'/>"
      
          Rectangle {
              anchors.fill: text
              color: 'grey'
              opacity: 0.2
          }
      
          Text {
              id: text
              anchors.centerIn: parent
              width: 80
              text: smile + smile + smile + smile + smile + smile + smile + smile + smile + smile + smile
              elide: Text.ElideRight
              maximumLineCount: 2
              wrapMode: Text.Wrap
          }
      }
      

      See attached example for repro.

      Attachments

        Issue Links

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              studiosus Vladimir Belyavsky
              Votes:
              9 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: