Hi
I have a Physics.qml
Item {
id: root
.........
signal destroyBullet()
onDestroyBullet: {
console.log("destroy Physics.qml")
root.destroy()
}
...........
}
Item {
id: root
.........
signal destroyBullet()
onDestroyBullet: {
console.log("destroy Physics.qml")
root.destroy()
}
...........
}
To copy to clipboard, switch view to plain text mode
and a Bullet.qml
import QtQuick 2.0
Physics {
id: root
................
onDestroyBullet: {
console.log("destroy Bullet.qml")
root.destroy()
}
.........
}
import QtQuick 2.0
Physics {
id: root
................
onDestroyBullet: {
console.log("destroy Bullet.qml")
root.destroy()
}
.........
}
To copy to clipboard, switch view to plain text mode
Bullet is dynamically created, when is destroyed, do I need to call destroy() in both Bullet.qml and Physics.qml ? Or it's enought just to call destroy in Physics.qml, or in Bullet.qml?
Bookmarks