hello.qml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. import Qt 4.7
  5. import Qt.labs.particles 1.0
  6. Image {
  7. id: background
  8. function initialize() { anim.start() }
  9. anchors.fill: parent
  10. source: "./frostyfield800x480.jpg"
  11. fillMode: "Stretch"
  12. Text {
  13. id: text
  14. property real rotationSpeed: 0
  15. font.bold: true
  16. text: "Hello World!"
  17. style: Text.Raised
  18. color: "steelblue"
  19. font.pixelSize: if(background.width / 15 < 1) { 1 } else { background.width / 15 }
  20. anchors.centerIn: parent
  21. opacity: 0.8
  22. PropertyAnimation {
  23. id: anim
  24. target: text
  25. running: false
  26. property: "rotation"
  27. from: 0
  28. to: 360
  29. duration: 10000
  30. }
  31. MouseArea {
  32. anchors.fill: parent
  33. onClicked: { anim.start() }
  34. }
  35. }
  36. Particles {
  37. anchors.fill: parent
  38. anchors.margins: 30
  39. source: "snowflake.png"
  40. opacity: 0.5
  41. lifeSpan: 5000
  42. emissionRate: 10
  43. lifeSpanDeviation: 200
  44. count: 50
  45. angle: 70
  46. angleDeviation: 45
  47. velocity: 30
  48. velocityDeviation: 10
  49. ParticleMotionWander {
  50. xvariance: 30
  51. pace: 100
  52. }
  53. }
  54. }