ArtDelegate.qml 436 B

123456789101112131415161718192021222324
  1. import QtQuick 2.5
  2. import Box2D 2.0
  3. import Qt.labs.settings 1.0
  4. ImageBoxBody {
  5. id: picture
  6. signal leftViewport
  7. function detonate() {
  8. leftViewport()
  9. picture.destroy()
  10. }
  11. onYChanged: y <= floor.y || detonate()
  12. density: 0.01
  13. friction: 1.0
  14. fixedRotation: parent.fixedRotation
  15. world: parent.physicsWorld
  16. bodyType: Body.Dynamic
  17. source: "file://" + imageModel.randomPicture()
  18. }