Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
b4d23e61ed19c770caf6b993a8ab0e4474d3f417
Description
Following test fails when run with QtTest. If you try similar case as "stand-alone" (e.g. with qmlscene) it works ok. Loader calls deleteLater() for the items, but the DeferredDelete event never reaches the items.
If you comment the verify lines out you can see that the item count keeps increasing, and you can see the "item destroyed" messages in sequence at the end (apparently they get deleted when the scene is deleted).
This is a blocker issue for some of our auto tests.
import QtQuick 2.0 import QtTest 1.0 Item { property int itemCount: 0 Loader { id: loader } Component { id: item Item { Component.onCompleted: { console.log("item created"); itemCount++ } Component.onDestruction: { console.log("item destroyed"); itemCount-- } } } resources: TestCase { name: "URL" function test_loader() { for (var i = 0; i < 5; i++) { loader.sourceComponent = item wait(100) console.log("itemCount: " + itemCount) verify(itemCount == 1) loader.sourceComponent = null wait(100) console.log("itemCount: " + itemCount) verify(itemCount == 0) } } } }