I'm trying to practice this transformation section.
I attached four images to the program and here are:
ClickableImage.qml:

Qt Code:
  1. import QtQuick 2.6
  2.  
  3. Image {
  4. id: root
  5. signal clicked
  6.  
  7. MouseArea
  8. {
  9. anchors.fill: parent
  10. onClicked: root.clicked
  11. }
  12. }
To copy to clipboard, switch view to plain text mode 

Transformation.qml:

Qt Code:
  1. import QtQuick 2.6
  2.  
  3. Item {
  4. width: bg.width
  5. height: bg.height
  6.  
  7. Image {
  8. id: bg
  9. source: "/background.png"
  10. }
  11.  
  12. MouseArea {
  13. id: backgroundClicker
  14. anchors.fill: parent
  15. onClicked: {
  16. circle.x = 84
  17. box.rotation = 0
  18. triangle.rotation = 0
  19. triangle.scale = 1.0
  20. }
  21. }
  22.  
  23. ClickableImage {
  24. id: circle
  25. x: 84; y: 68
  26. source: "/circle_blue.png"
  27. antialiasing: true
  28. onClicked: x += 20
  29. }
  30.  
  31. ClickableImage {
  32. id: box
  33. x: 164; y: 68
  34. source: "/box_green.png"
  35. antialiasing: true
  36. onClicked: rotation += 15
  37. }
  38.  
  39. ClickableImage {
  40. id: triangle
  41. x: 248; y: 68
  42. source: "/triangle_red.png"
  43. antialiasing: true
  44. onClicked: {
  45. rotation += 15
  46. scale += 0.05
  47. }
  48. }
  49.  
  50. function _test_transformed() {
  51. circle.x += 20
  52. box.rotation = 15
  53. triangle.scale = 1.2
  54. triangle.rotation = -15
  55. }
  56.  
  57. function _test_overlap() {
  58. circle.x += 40
  59. box.rotation = 15
  60. triangle.scale = 2.0
  61. triangle.rotation = 45
  62. }
  63.  
  64. }
To copy to clipboard, switch view to plain text mode 

main.qml:

Qt Code:
  1. import QtQuick 2.6
  2. import QtQuick.Window 2.2
  3.  
  4. Window {
  5. visible: true
  6. width: 800
  7. height: 600
  8. title: qsTr("Transformation")
  9.  
  10. Transformation {
  11. id: transformation
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 

When I run the program it shows the images, but nothing happens when I click on any of them! Why please?
And how to use all advantages of Transformation.qml file in main.qml, please?