Qt Code:
  1. import QtQuick 2.0
  2.  
  3. Item
  4. {
  5. width: 660
  6. height: 660
  7.  
  8. Rectangle
  9. {
  10. id : dial
  11. width: 360
  12. height: 360
  13.  
  14. color: "gray"
  15.  
  16. Rectangle
  17. {
  18. id: dot
  19. height: 5
  20. width: 5
  21. color: "red"
  22. x: dial.x + (dial.width/2);
  23. y: dial.y + (dial.height/2);
  24. }
  25.  
  26. Image
  27. {
  28. id: line
  29. source: "/home/.../documents/test/straightLine.jpg"
  30. height: 50
  31. width: 50
  32. anchors.horizontalCenter: parent.horizontalCenter
  33. anchors.verticalCenter: parent.verticalCenter
  34. transform: Rotation
  35. {
  36. origin.x: dial.x + (dial.width/2);
  37. origin.y: dial.y + (dial.height/2);
  38. angle: 40
  39. }
  40. }
  41. }
  42. }
To copy to clipboard, switch view to plain text mode 

The dot is a representation of the origin point. The line's center point should stay at that origin.

When I apply the angle : 40, the line moves away from its origin.

How to tell it to say at that origin while rotating?