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

Setting an anchor to undefined does nothing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.0.0, 5.1.0 , 5.2.0, 5.3.0, 5.4.0 Beta
    • None

    Description

      Click the MouseArea at the top of the screen to switch between an anchor being assigned to a valid anchor and being assigned undefined. Clicking it will do nothing.

      import QtQuick 2.0
      
      Rectangle {
          width: 400
          height: 400
          visible: true
      
          Rectangle {
              id: rect
              x: 100
              y: 100
              width: 32
              height: 32
              color: "salmon"
      
              Text {
                  id: textItem
                  text: "32"
                  anchors.horizontalCenter: parent.horizontalCenter
                  anchors.bottom: checkBox.checked ? parent.bottom : undefined
              }
          }
      
          Text {
              text: "anchors.bottom = " + (checkBox.checked ? "parent.bottom" : "undefined")
              id: checkBox
              anchors.horizontalCenter: parent.horizontalCenter
      
              property bool checked: false
      
              MouseArea {
                  anchors.fill: parent
                  onClicked: parent.checked = !parent.checked
              }
      
              Rectangle {
                  anchors.fill: parent
                  color: "transparent"
                  border.color: "red"
              }
          }
      }
      

      Attachments

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

        Activity

          People

            aalpert Alan Alpert
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes