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

all bindings should be updated before any onXXXChanged handler run

    XMLWordPrintable

Details

    Description

      We have an object "base" with property "prop", and a number of bindings, say:

      element1.prop1: base.prop + "A"
      element2.prop2: base.prop + "B"
      element3.prop3: base.prop + "C"
      element4.prop4: base.prop + "D"
      element5.prop5: base.prop + "E"
      element6.prop6: base.prop + "F"
      element7.prop7: base.prop + "G"

      then if in element1.onProp1Changed: we check value of base.prop or value of element1.prop1 they show already the new value. BUT if in the same function (slot connected to signal handler element1.onProp1Changed) we check the value of element2.prop2, element3.prop3 etc., they will sometimes (?!) show still the old value... In fact in the slot on prop1 we had a loop over elements 2-7 and in this loop first few elements had still not updated, old values of the properties and then next properties had already new values...

      This can be very confusing. This is really not what we expected.

      And since in element1.onProp1Changed we cannot rely on other properties being up to date, we had to introduce a much, much more complex design...

      -----------

      If possible, it would be much more clear (and would match what one expects!) if:

      • all directly bound values were updated first
      • and only then the onXXXChanged slots were triggered

      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
              wiecko Marek Wieckowski
              Votes:
              9 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes