title: Why I can't anchor QML Items to one another
body: <p>I have this code:</p>
  
  <pre><code>import QtQuick 2.7
  import QtQuick.Window 2.2
  
  Window {
      visible: true
  
      width: 640
      height: 480
  
      title: qsTr("Hello World")
  
      Rectangle {
          anchors.fill: parent
  
          Rectangle {
              id: rect1
  
              anchors.top: parent.top
              anchors.left: parent.left
              anchors.right: rect2.left
              anchors.bottom: parent.bottom
              color: "red"
          }
  
          Rectangle {
              id: rect2
  
              anchors.top: parent.top
              anchors.left: rect1.right
              anchors.right: parent.right
              anchors.bottom: parent.bottom
              color: "blue"
          }
      }
  }
  </code></pre>
  
  <p>I want to anchor the two rects to one another so the following output is generated:</p>
  
  <p><a href="https://i.stack.imgur.com/JWp5c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JWp5c.png" alt="enter image description here"></a></p>
  
  <p>Why doesn't my code do so? I would prefer not to use layouts...</p>