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

Elide causes contentWidth to become zero

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 5.5.0 RC
    • Quick: Layouts
    • None

    Description

      A text's 'contentWidth' becomse zero when elide is set to something other than default.

      See attached example.

              RowLayout {
                  id: rowLayout
      
                  anchors.fill: parent
      
                  spacing: 5
      
                  Component.onCompleted: {
                      console.log("headerText.contentWidth",headerText.contentWidth,"oddsText.contentWidth",oddsText.contentWidth);
                  }
      
                  Rectangle {
                      id: headerTextContainer
      
                      Layout.fillHeight: true
                      Layout.fillWidth: true
      
                      color: "blue"
      
                      Text {
                          id: headerText
      
                          height: parent.height
                          width: parent.width
      
                          elide: Text.ElideRight
      
                          text: "Helllloooooooooo"
                      }
                  }
      
                  Rectangle {
                      id: oddsTextContainer
      
                      Layout.fillHeight: true
                      Layout.fillWidth: true
      
                      color: "green"
      
                      Text {
                          id: oddsText
      
                          height: parent.height
                          width: parent.width
      
                          text: "Helllloooooooooo"
                      }
                  }
              }
      

      Attachments

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

        Activity

          People

            smd Jan Arve
            hughman Jack Hughman
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes