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

Applying a Behavior on an attached property asserts

XMLWordPrintable

      I believe this is a bug in the Behavior element of the QML language. However, only layouts currently uses attached properties that can in theory be animated (however, its a bad idea due to performance reasons).
      I'm not sure if we want the Behavior element to support attached properties like this, but it should not assert.

      Opening this with qmlscene gives:

      ASSERT: "mo" in file qml\qqmlvme.cpp, line 853

      import QtQuick 2.1
      import QtQuick.Layouts 1.1
      
      Item {
          width: 300
          height: 400
          
          RowLayout {
              anchors.fill: parent
              Rectangle {
                  color: "red"
                  Layout.preferredWidth: 50
                  Layout.fillHeight: true
              }
              Rectangle {
                  color: "yellow"
                  Layout.fillWidth: true
                  Layout.fillHeight: true
              }
              Behavior on Layout.preferredWidth {
                  NumberAnimation { duration: 1000 }
              }
          }
      }
      

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

            shausman Simon Hausmann
            smd Jan Arve
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes