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

Non-breaking space does not work with StyledText

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.4.1
    • None
    • Qt 5.4.1 on Linux Mint 17
    • 8b205fd05dcdc4a0e7ec6b25429f691a0a9099fe

    Description

      A non-breaking space character is not rendered at all (not even as a regular space) when using StyledText, it works when using RichText. However, using RichText just for this is massively overkill.

      import QtQuick 2.3
      import QtQuick.Layouts 1.1
      
      ColumnLayout {
          Text { // the spaces will be invisible
              Layout.fillWidth: true
              text: "This Text should not wrap but look as if there were spacs"
              textFormat: Text.StyledText
              wrapMode: Text.WordWrap
          }
      
          Text { // the spaces are rendered properly and won't wrap
              Layout.fillWidth: true
              text: "This Text should not wrap but look as if there were spaces"
              textFormat: Text.RichText
              wrapMode: Text.WordWrap
          }
      }
      

      It makes no difference whether I use   or a non-breaking space literal.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            broulik Kai Uwe Broulik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes