I have a QGraphicsView that is transformed (scaled, translated, rotated) by a few functions.
At a given point, I'd like to set its rotation to a certain value. Even better, I'd like to have its scale, translation and rotation. However, the goal is to change its rotation but keep the translation and scale.
I don't need to have the original transformation order.
I've only seen .rotate() but there's no .setRotation() and I am not sure how to retrieve the rotation angle correctly. At the moment there's no shear, so I've read that "The simplest general way is to transform (0,0) and (1,0), then use trigonometric functions (arctan) to get the angle".
But I'd would like to know how this is usually done. At the moment I keep track of the scale and rebuild a new transform, but it's far from ideal and it would break if other transformations were made.
Bookmarks