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

    • 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

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

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes