Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.10, 5.15, 6.2.5, 6.2, 6.3.0 Beta3, 6.3, 6.4.0 Beta1
-
5.9.2, 5.15.8, 6.2.2
-
Qt 5.9.2 msvc2015_64 on Windows 10
-
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 {}