Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QGraphicsItemAnimation setRotateAt rotates around scene 0,0 how do i set it to rotate around QGraphicsItem center
icewhite1981 last edited by
For several reasons (the biggest of which is the legacy codebase I am working with) I am forced to use QGraphicsItemAnimation to animate QGraphicsItems on our scene I am trying to implement a simple rotate animation for test purposes. I have implemented the code and the item rotates almost as expected. However the Rotation is around the 0,0 of the scene rather than the 0,0 of the Item. Ideally I would like the rotation to occur around the center of the QGraphicsItem
Any ideas on how I can achieve this calling setTransformOriginPoint doesn't work and to be honest I don't really want to change the item I am animating in anyway. Can this be done just using the QGraphicsItemAnimation so the translation to rotate around item center can be applied on a temporary basis. If this is not possible any thoughts as to how I can achieve this generally if a solution cannot be applied to the animation object.
Please note I have tried applying the translation using the QGraphicsItemAnimation function setTranslationAt