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

Invalid Text.paintedWidth when Text.elide set.

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes