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

Binding a property multiple times should be an error

XMLWordPrintable

      The compiler right now allows multiple bindings of the same property. E.g.:

      Rectangle {
        width: 300
        height: 200
        color: "blue"
        color: "red"
      }
      

      This does not result in an error or warning - the last binding of color 'overrides' the previous one. This is IMO unexpected, and can easily lead to effects which are hard to understand.

      Current Behaviors, though, rely on this feature, e.g.:

           
          y: 200  //initial value
          y: Behavior {
               NumberAnimation {
                   easing: "easeOutBounce(amplitude:100)"
                   duration: 200
               }
           }
      

      This could maybe be also be tackled by having a 'initialValue' property in the Behavior definition.

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

            aakenned Aaron Kennedy
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes