Hello forum,

I have declared a Grid item to position its children in grid formation. Then I have a Rectangle item to act as a frame as follows:

Qt Code:
  1. Rectangle {
  2. id: rect
  3. color: "red"
  4. radius: 10
  5. opacity: 0.1
  6. border.color: "black"
  7. focus: true
  8. //the rectangle element
  9. //will fill the whole grid container
  10. anchors.fill: controlContainer
  11.  
  12. Keys.onPressed: {
  13. if(event.key === Qt.Key_F1)
  14. {
  15. console.log('Key F1 was pressed')
  16. event.accepted = true
  17. }
  18. }
  19.  
  20. }
To copy to clipboard, switch view to plain text mode 

I want to apply spring animation with the key press event . In that case do I have to apply animation to rectangle only or both ?

Thanks