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

[REG 6.6 → 6.8] Broken list property update when the setter delays modification

XMLWordPrintable

      Stumbled on an edge case which worked fine in Qt 6.5 and Qt 6.6 but broke in Qt 6.8 and Qt 6.9.

      Consider the following:

      let v = object.someListProperty
      v[1] = 42
      object.someListProperty = v
      

      When the C++-defined setter setSomeListProperty() updates the data asynchronously, this breaks, and the explicit write-back in the last line actually restores the original value, nullifying the change altogether.

      Some background:
      Our setters are asynchronous because the objects in question are remote. Any property change first goes over the network and is only applied locally when we get the confirmation of success from the remote.

      We used to do it this way since before Qt 6.5 it was the only way to update a single element of a QVariantList property. Then Qt 6.5 gained the ability to modify QVariantList properties in-place, so the write-back is not necessary anymore. But it also did not hurt. Same for Qt 6.6.
      This changed with Qt 6.8 where the behavior is as describe above. The write-back actually restores the original value, which is counter-intuitive.

      Did not test Qt 6.7.

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

            ulherman Ulf Hermann
            msarehn Arno Rehn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes