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

Arrays in objects returned by ListModel::get(index) are not visible to JSON.stringify()

    XMLWordPrintable

Details

    Description

      The example ist selfexplanatory:

      $ qmlviewer Test.qml
      {"name":"example","list":{"objectName":"","count":2}}

      QDeclarativeView only supports loading of root objects that derive from QGraphicsObject (This second line is logic and does not matter. I wanted the example to be as small es possible.)

      The output I expected should look like this:

      $ qmlviewer Test.qml
      {"name":"example","list":[

      {"doesnt":"work"}

      ,

      {"doesnt":"work"}

      ]}

      This is in my opinion definitely a bug in the implementation of the get() method. It could possibly be resolved by importing QtQuick 1.0 or QtQuick 1.1 instead of Qt 4.7. But I cannot try this because of another but probably unrelated problem.

      I hope this bugreport is useful. And for my purposes working arrays would be really nice. QML is really nice work. Thanks for your work!

      Greetings

      Attachments

        1. Test.qml
          0.2 kB
          Malte Brandy
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            glwatson Glenn Watson
            maralorn Malte Brandy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes