import QtQuick 1.0 Rectangle { id: rect width: 80; height: 80 color: "red" NumberAnimation on opacity { to: 0 duration: 1000 onRunningChanged: { if (!running) { console.log("Destroying...") rect.destroy(); } } } }
import QtQuick 1.0Item { id:root width:300 height: 300 Rectangle { id: firstRect x: 50 y: 50 width: 100 height: 100 color: "red" } Rectangle { id: secondRect x : 160 y: 50 width:100 height: 100 color: "blue" MouseArea { anchors.fill: parent onClicked: { firstRect.destroy() } } }}