Advertisement
Guest User

test

a guest
May 30th, 2015
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. import QtQuick 2.0
  2. import Ubuntu.Components 0.1
  3. import "components"
  4. import QtMultimedia 5.0
  5. /*!
  6. \brief MainView with a Label and Button elements.
  7. */
  8.  
  9. MainView {
  10. // objectName for functional testing purposes (autopilot-qt5)
  11. objectName: "mainView"
  12.  
  13. // Note! applicationName needs to match the "name" field of the click manifest
  14. applicationName: "com.ubuntu.developer..salut"
  15.  
  16. /*
  17. This property enables the application to change orientation
  18. when the device is rotated. The default is false.
  19. */
  20. //automaticOrientation: true
  21.  
  22. width: units.gu(100)
  23. height: units.gu(75)
  24. Grid{
  25. columns: 2
  26. rows: 2
  27. columnSpacing: units.gu(2)
  28. rowSpacing: units.gu(2)
  29.  
  30. UbuntuShape {
  31.  
  32. Audio {
  33. id: sound
  34. source : "elephant.ogg"
  35. }
  36.  
  37. MouseArea {
  38. anchors.fill: parent
  39. onPressed: {
  40. sound.play();
  41.  
  42. }
  43. }
  44.  
  45. radius: "medium"
  46. image: Image {
  47. source: "elephant.png"
  48. }
  49.  
  50. }
  51.  
  52.  
  53. UbuntuShape {
  54.  
  55. image: Image {
  56. source: "cat.png"
  57. }
  58. }
  59. UbuntuShape {
  60.  
  61. image: Image {
  62. source: "cat.png"
  63. }
  64. }
  65. UbuntuShape {
  66. id : box
  67. radius: "medium"
  68. image: Image {
  69. source: "ubuntu_logo.png"
  70. }
  71. SequentialAnimation {
  72. id: animation
  73. RotationAnimation {
  74. target: box
  75. properties: "rotation"
  76. duration: 100
  77. to: 10
  78. easing.type: Easing.OutQuad
  79. }
  80. RotationAnimation {
  81. target: box
  82. properties: "rotation"
  83. duration: 200
  84. to: -10
  85. easing.type: Easing.OutQuad
  86. }
  87. }
  88. MouseArea {
  89. anchors.fill: parent
  90. onPressed: { animation.start();
  91. }
  92. }
  93. }
  94. }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement