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

QML Text - elide does not work with Text.StyledText format if the text contains hard breaks

XMLWordPrintable

    • macOS

      The following example

      Text {
                  Layout.maximumWidth: 300
                  font.pixelSize: 14
                  color: "black"
                  text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
                  elide: Text.ElideRight
                  maximumLineCount: 1
                  textFormat: Text.StyledText
      
                  Rectangle {
                      anchors.fill: parent
                      color: Qt.rgba(0,0,1, 0.2)
                  }
              }
      
              Text {
                  Layout.maximumWidth: 300
                  font.pixelSize: 14
                  color: "black"
                  text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
      magna aliqua."
                  elide: Text.ElideRight
                  maximumLineCount: 1
                  textFormat: Text.StyledText
      
                  Rectangle {
                      anchors.fill: parent
                      color: Qt.rgba(1,0,0, 0.2)
                  }
              }
      

      Second text is not elided correctly.

      Reproduces with Text.StyledText

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

            esabraha Eskil Abrahamsen Blomfeldt
            sergei.nevdakh Sergei Nevdakh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes