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

Crash when changing Loader source inside a Repeater when the model changes

    XMLWordPrintable

Details

    • 79e885537f (qt/qtdeclarative/dev) 9e14afa9a0 (qt/qtdeclarative/6.3) 1bbe56d97c (qt/qtdeclarative/6.2) d76efbe8ef (qt/tqtc-qtdeclarative/5.15)

    Description

      When the source of a Loader inside a Repeater changes immediately after the model changes, it causes an assertion failure in debug mode, and a crash in releas mode. The assert message is:

       

      ASSERT: "e" in file c:\users\qt\work\qt\qtdeclarative\include\qtqml\5.9.2\qtqml\private\../../../../../src/qml/qml/qqmlengine_p.h, line 400
      
      Debug Error!
      
      
      
      Program: C:\Qt\5.9.2\msvc2015_64\bin\Qt5Cored.dll
      
      Module: 5.9.2
      
      File: c:\users\qt\work\qt\qtdeclarative\include\qtqml\5.9.2\qtqml\private\../../../../../src/qml/qml/qqmlengine_p.h
      
      Line: 400
      
      
      
      ASSERT: "e" in file c:\users\qt\work\qt\qtdeclarative\include\qtqml\5.9.2\qtqml\private\../../../../../src/qml/qml/qqmlengine_p.h, line 400
      

       

      Here's a little example:

      import QtQuick 2.8
      
      Item {
          id: root
          visible: true
      
          property bool a: false
          onAChanged: {
              m.model = 0
              m.model = 1
          }
      
          Repeater {
              id: m
              anchors.fill: parent
              model: 1
      
              Item {
                  anchors.fill: parent
                  id: delegate
                  MouseArea {
                      anchors.fill: parent
                      onClicked: {
                          root.a = true
                          l.source = "loaded.qml"
                      }
                  }
                  Loader {
                      id: l
                  }
              }
          }
      }
      
      

      loaded.qml can be anything. I used:

      import QtQuick 2.0
      Item {}
      

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            zcapalbo Zachary Capalbo
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes