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

[Regression] Crash when appending to ListModel

XMLWordPrintable

    • 212e961fc8abefb23f5de3c6057556caeeacdc30 (qtdeclarative)

      The following code causes a crash with Qt 5.2:

      import QtQuick 2.0
      
      Item {
          width: 400; height: 400
      
          ListModel { id: listModel }
      
          Component.onCompleted: {
              // crashes in 5.2 (in 5.1 there is no crash, but also no way to access the sub-elements of 'ids')
              listModel.append( { description: "fruit", "ids": [ "7937", "1247", "0543"] } )
              listModel.append( { description: "veggies", "ids": [ "9378", "2234", "0987" ] } )
          }
      }
      

      As noted in the code, in 5.1 this does not crash, but also does not seem correct – it does not generate any warning/error, but also does not provide any way to access the sub-elements of 'ids' (as far as I know ListModel does not support lists of basic types, but scanning the ListModel/ListElement docs I did not notice this issue being directly addressed).

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

            shausman Simon Hausmann
            mbrasser Michael Brasser
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes