Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.14.2, 5.15.1, 6.0
-
-
a1c1ad11ce6f4a415cefc583cfab41336ecf71e3 (qt/qtdeclarative/dev) e51f6cd8af19d1c55faae39e0e1c0203b619fb19 (qt/qtdeclarative/6.2) e25c25453c (qt/tqtc-qtdeclarative/5.15)
Description
Hello,
Instantiator creates and destroys delegate when active property is false and delegate is updated.
[Reading the documentation](https://doc-snapshots.qt.io/qt5-5.14/qml-qtqml-models-instantiator.html#active-prop), no objects should be created or destroyed.
A sandbox project with minimalist code is attached to this issue.
Best regards
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.5 import QtQuick.Layouts 1.12 import QtQml.Models 2.12 Window { id: root width: 640 height: 480 visible: true title: qsTr("Hello World") Component { id: componentTest QtObject { Component.onCompleted: { console.warn("!=======Component instantiated============!") } Component.onDestruction: { console.warn("!=======Component destructed============!") } } } Component.onCompleted: { instantiator.delegate = componentTest } Instantiator { id: instantiator active: false } }