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

Unexpected text's rectangle behavior in a row

    XMLWordPrintable

Details

    Description

      Rectangle of a text type unexpected rendered within row layout in QML.

      Snippet to reproduce the issue:

      Window {
          width: 640
          height: 480
          visible: true
          title: "QML Row Example"    
      
          Column {
              spacing: 20
              anchors.centerIn: parent        
              
              // First Row: Correct Behavior
              Row {
                  spacing: 10            
                  Rectangle {
                      width: 20
                      height: 20
                      color: "grey"
                  }            
                  Text {
                      text: "hello"
                      Rectangle {
                          anchors.fill: parent
                          anchors.margins: -5
                          opacity: 0.5
                          color: "red"
                      }
                  }
              }        
       
              // Second Row: Unexpected red rectangle behavior
              Row {
                  spacing: 10            
                  Rectangle {
                      width: 20
                      height: 20
                      color: "grey"
                  }            
                  Text {
                      text: ""
                      Rectangle {
                          anchors.fill: parent
                          anchors.margins: -5
                          opacity: 0.5
                          color: "red"
                      }
                  }
              }
          }
      } 

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            kitruong Kinh Truong
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes