ArtDelegate.qml 387 B

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