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

Item.childrenRect broken when all children lie outside the first quadrant

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.3.0 Beta1
    • None

    Description

      The childenRect always touches the item's origin when the childrenRect's x or y coordinate is negative — no matter where the children are placed.

      Sample code:

      import QtQuick 2.1
      
      Item {
          width: 800
          height: 600
      
          Item {
              anchors.centerIn: parent
      
              Item {
                  id: container
                  Rectangle {
                      x: -200
                      y: -200
                      width: 30
                      height: 30
                      color: "red"
                      MouseArea {
                          anchors.fill: parent
                          drag.target : parent
                      }
                  }
      
                  Rectangle {
                      x: -60
                      y: -60
                      width: 30
                      height: 30
                      color: "red"
                      MouseArea {
                          anchors.fill: parent
                          drag.target : parent
                      }
                  }
              }
      
              Rectangle {
                  id: origin
                  width: 5
                  height: 5
                  color: "black"
              }
      
              Rectangle {
                  id: visualizeChildrenRect
                  x: container.childrenRect.x
                  y: container.childrenRect.y
                  width: container.childrenRect.width
                  height: container.childrenRect.height
                  color: "red"
                  opacity: 0.5
              }
          }
      }
      

      Actual result:

      Expected result:

      Attachments

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

        Activity

          People

            aalpert Alan Alpert
            lassos lassos
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes