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

NBSP between <img> tag and text doesn't prevent wrapping

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.2.4, 6.3.1
    • GUI: Text handling
    • None
    • All

    Description

      Non-breaking space (nbsp) between <img> tag and text doesn't prevent wrapping.

      Example:

      import QtQuick
      
      Window {
          width: 640
          height: 480
          visible: true
      
          Text {
              width: 40
              wrapMode: Text.WordWrap
      
              readonly property string inlineImage: "<img src='qrc:/(smile).png' width='18' height='18'/>"
      
              text: inlineImage + '&nbsp;' + 'text'
              textFormat: Text.StyledText
      
              Rectangle {
                  anchors.fill: parent
                  color: 'transparent'
                  border.width: 1
              }
          }
      }
      

      Actual result: text is wrapped after the image
      Expected result: text shouldn't be wrapped and should be displayed in one line

       

      see full example  TextIssue 2.zip

      Attachments

        1. image-2022-07-22-17-08-02-243.png
          image-2022-07-22-17-08-02-243.png
          134 kB
        2. image-nbsp.html
          0.1 kB
        3. red.png
          red.png
          0.1 kB
        4. TextIssue 2.zip
          3 kB
        For Gerrit Dashboard: QTBUG-105143
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes