PDA

View Full Version : Suggestion on how to retrieve the pos of a GraphicsObject during animation



SlaynX
25th May 2011, 17:08
I had a GraphicsObject(let say a missle) and it can animate just like the animation of sprites and also clickable since it has a mousepressevent. However I used QPropertyAnimation to handle the object movements. Then I had another GraphicsObject similar to the previous one (let say this time a explosion). So the scenario is when the user clicks on the missle (moving downwards) and the object will be deleted but the hard part was to be able to create the explosion animation exactly at the position where the missle was clicked. Is there any suggestion on how to retrieve the position or should I change the structure of my code into a better form rather using the QPropertyAnimation? Please help me. (Forgive me for the grammer mistakes :( )

wysota
25th May 2011, 17:56
QGraphicsItem::pos() will give you the current position of an item.