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

Invalid Text.paintedWidth when Text.elide set.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.7.2
    • None
    • MS Windows 7, MS Visual Studio 2008

      Open following Item in qmlviewer.

      import QtQuick 1.0
      
      Rectangle {
          width: 200
          height: 60
      
          color: "lightblue"
      
          Column {
              anchors {
                  fill: parent
                  margins: 10
              }
      
              spacing: 10
      
              Text {
                  width: parent.width
      
                  text: "test"
      
                  Rectangle {
                      anchors.top: parent.bottom
                      width: parent.paintedWidth
                      height: 2
      
                      color: "darkgreen"
                  }
              }
      
              Text {
                  width: parent.width
      
                  elide: Text.ElideRight
      
                  text: "test"
      
                  Rectangle {
                      anchors.top: parent.bottom
                      width: parent.paintedWidth
                      height: 2
      
                      color: "red"
                  }
              }
          }
      }

      Green line correctly matches text length. Red line is painted to the right side. Text items differs only in elide attribute.

      Length of red line should match text length.

      In Qt 4.7.1 red line is drawn correctly.

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

            martjone Martin Jones (closed Nokia identity) (Inactive)
            scavenger Pavel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes