ArtDelegate.qml 407 B

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