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

QML Text element elides text when its explicit width equals to the implicit width

    XMLWordPrintable

Details

    Description

      Steps to reproduce:

      • write some text in the red box

      Expected outcome:

      • the text in the blue box is NOT elided

      Actual outcome:

      • the text in the blue box is often elided, especially when adding more characters
      import QtQuick 2.0
      
      Rectangle {
          width: 360
          height: 360
      
          Column {
              spacing: 10
              anchors.centerIn: parent
      
              Text {
                  text: input.text
                  width: implicitWidth // <---
                  elide: Text.ElideRight
                  Rectangle { border.color: "blue"; color: "transparent";  anchors.fill: parent }
              }
      
              TextInput {
                  id: input
                  focus: true
                  text: "Hello World"
                  Rectangle { border.color: "red"; color: "transparent";  anchors.fill: parent }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            jpnurmi J-P Nurmi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes