I just want to move the image by the widget\'s axises and rotate around the widget\'s center(like a canvas in any digital painting software), but it\'s rotating around its l
The usual reason an object rotates around its top left point, rather than its centre, is because it has its dimensions defined with 0,0 at the top left, rather than being in the centre of the object.
You haven't shown what the 'canvas' object is, so assuming it's something like a QGraphicsRectItem, you'd need to declare its top left, width, height as -x/2, -y/2, width, height to ensure that the centre point of the object is at 0,0. Then when you rotate the object, it will rotate about its centre.
Additionally, you should try to separate the rotation and translation logic from the painting functions for optimum performance.