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

[6.2.4 -> 6.4.0] QML: QVariantList is not automatically converted to array

XMLWordPrintable

    • Linux/Other display system, macOS

      Complete example was added to Attachments (qvariantlist_bug.zip)

      Consider following property declared in C++ code:

      QPROPERTY(QVariantList values READ values NOTIFY valuesChanged)

      This property is later used in QML: 

      property var values: provider.values.reverse()
      

      How I expected this code to work: provider.values is converted to JS array, reverse() method of JS array is called. It used to work like this until the update from Qt 6.2.4 to Qt 6.4.0 happened.

      In QML debugger I'm able to observe that QVariantList is now converted to an object with string properties instead of Array of strings.

       

        1. qvariantlist_bug.zip
          2 kB
          hmi ui
        2. console_log_6_2_4.jpg
          24 kB
          hmi ui
        3. console_log_6_4_0.jpg
          30 kB
          hmi ui
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ulherman Ulf Hermann
            hmi hmi ui
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes