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

[Reg 6.5 -> 6.8] Inconsistency between 6.8.4 and 6.9.2 when it comes to changing QML array element

XMLWordPrintable

      Although it is inconsistency, I think Qt6.9.x has the correct behavior and 6.8.4 is the bugged one. Anyway, a reproducer attached.

      The log from 6.8.4:

      qml: array: [{"count":0},{"count":1}]
      qml: array[0] before: {"count":0}
      qml: array[0] after: {"count":0} //This is the weird part, that it stays "0"
      qml: array after: [{"count":0},{"count":1}]
      

      The log from 6.9.2:

      qml: array: [{"count":0},{"count":1}]
      qml: array[0] before: {"count":0}
      qml: array[0] after: {"count":100} //Good, assignment is correctly reflected
      qml: array after: [{"count":100},{"count":1}]
      

      To make 6.8.4 behave in the "correct" way, a workaround is to replace the entire element. So:

      array[0] = {"count": 100}
      

      instead of

      array[0].count = 100
      

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

            ulherman Ulf Hermann
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes