Hello. I found that QML trying to call object's methods even when it destroyed.
It's my main.qml file: import QtQuick 1.1 Rectangle { id: appWindow width: 360 height: 360 property int i: 0; property real step: 0.1; property Component component; signal trigger(int dx) Text { text: qsTr("Hello World") anchors.centerIn: parent } MouseArea { anchors.fill: parent onClicked: { //Qt.quit(); trigger(100); component = Qt.createComponent("Note.qml"); if(component != null) continueCreation(); else component.ready.connect(continueCreation); } } onTrigger: { console.log("parent trigger"); } function destruction(obj) { console.log("destruction"); trigger.disconnect(obj.move); } function continueCreation() { var sprite = component.createObject(appWindow, {"x": 100, "y": 100, "color":Qt.rgba(1, i*step, 1-i*step, 1)}); if (sprite == null) { // Error Handling console.log("Error creating object"); } sprite.destruction.connect(destruction); trigger.connect(sprite.move); i++; } } It's my Note.qml file: import QtQuick 1.1 Rectangle { id: note width: 100 height: 62 color: "red" //signal move(); signal destruction(variant obj); MouseArea { anchors.fill: parent onClicked: { destruction(this); note.destroy(); } } function move(dx) { x += dx } } Why it can't disconnect signal when object destroyed? How to do this right? Sorry, I'm novice in QML. Best regards, Nick
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest