Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-30596 bi-directional or multi-sync variation of Binding
  3. QTBUG-132543

Extend Binding's late-bound mode to also allow aliases

    XMLWordPrintable

Details

    Description

      In Binding's late-bound mode, if an alias rather than a property is declared, The synchronization of the properties shall happen in both directions. For examples:

      Binding {
          target: foo
          property alias bar: other.baz
      }
      

      This would listen for changes to foo.bar as well as other.baz (via the actually existing alias) and update either of those when the other one changes.

      foo.bar retroactively "becomes" an alias of other.baz this way.

      An interesting question here is what happens to restoreMode. We potentially have two properties to restore if the binding is deactivated. The easiest way to deal with that is lazy breaking and restoring of bindings. Whenever, during an update of the properties, we see a binding break on one side of the retroactive alias, we stash away the broken binding, overwriting any previous stashed binding we may have for that side. When the Binding element is deactivated, we restore whatever we have at that point, using the restoreMode rules.

      Attachments

        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:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes