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

Allow binding to members of JavaScript objects and arrays

    XMLWordPrintable

Details

    Description

      Currently the following binds a to the initial value of b.c, but doesn't update a when b.c is updated. This is highly surprising and runs counter to our understanding of bindings:

      QtObject {
          property var b: ({c : 10})
          property var a: b.c
      
          signal somethingHappened
          onSomethingHappened: function() { ++b.c }
      }
      

      The same effect can be seen for JavaScript arrays in var properties. We should either not allow such bindings in the first place (syntax for declarative one-time assignment might come in handy), or, preferably, properly update the binding when the source changes.

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              ulherman Ulf Hermann
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes