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

[Regr:5->6] Size bindings can be invalidated when anchors are set

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P1: Critical
    • None
    • 6.6.1
    • None
    • Linux/Wayland, Linux/X11

    Description

      When I have an item and in the item size and anchors properties bind to the same property, when the property changes, the size bindings will be invalidated. This is a regression in Qt6 as it can't be reproduced in Qt5.

       

      STR: Click the empty area and watch the red line

       

      import QtQuick 2.15
      
      Item {
          id: plasmoid
          width: 300
          height: 300
          property int location: 0
      
          TapHandler {
              onTapped: if (plasmoid.location === 3) {
                  plasmoid.location = 0;
              } else {
                  plasmoid.location += 1;
              }
          }
      
          Rectangle {
              anchors {
                  top: plasmoid.location === 0 ? undefined : parent.top
                  left: plasmoid.location === 1 ? undefined : parent.left
                  right: plasmoid.location === 2 ? undefined : parent.right
                  bottom: plasmoid.location === 3 ? undefined : parent.bottom
              }
              height: (plasmoid.location === 3 || plasmoid.location === 0) ? 1 : undefined
              width: (plasmoid.location === 2 || plasmoid.location === 1) ? 1 : undefined
              z: 999 /* Draw the line on top of the applet */
              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
            fusionfuture Yuanzheng Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes