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

JSONifying ListModel.get crashes if the content is a list-containing object

    XMLWordPrintable

Details

    • 8ea33db63505cbdbad3d298908211d78a4812519 (qt/qtdeclarative/5.15)

    Description

      Example:

      import QtQuick 2.5
      Item {
          visible: true
          width: 640
          height: 480
          ListModel {
              id : model
          }
          Component.onCompleted: {
              var tempData = {
                  subItems: []
              }
              model.insert(0, tempData)
              JSON.stringify(model.get(0))
          }
      }
      

      This will crash inside QQmlListModel::QQmlListModel > ListLayout::ListLayout, as orig->m_layout is a nullptr. Why we even end in this codepath is yet to be determined.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            fabiankosmale Fabian Kosmale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes