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

Details

    • Linux/Other display system, macOS

    Description

      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.

       

      Attachments

        1. console_log_6_2_4.jpg
          24 kB
          hmi ui
        2. console_log_6_4_0.jpg
          30 kB
          hmi ui
        3. qvariantlist_bug.zip
          2 kB
          hmi ui

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: