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

[Regression] Crash when appending to ListModel

    XMLWordPrintable

Details

    • 212e961fc8abefb23f5de3c6057556caeeacdc30 (qtdeclarative)

    Description

      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).

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-35891
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes