Hello guys I am new to this forum and this is my first thread and now to my problem.
I can not resize correctly after rotation. It seems like the position of my item is shifted.
For example, if I place my item to the mouse position, the corner of my item is not under the mouse.
It is shifted a little bit. It seems like something went wrong with my translation.
I used the following code for rotation.
QTransform transform;
transform.translate(boundingRect().width()/2, boundingRect().height()/2);
transform.rotate(getRotationAngle(event));
transform.translate(-(boundingRect().width()/2), -(boundingRect().height()/2));
setTransform(transform);
QTransform transform;
transform.translate(boundingRect().width()/2, boundingRect().height()/2);
transform.rotate(getRotationAngle(event));
transform.translate(-(boundingRect().width()/2), -(boundingRect().height()/2));
setTransform(transform);
To copy to clipboard, switch view to plain text mode
Bookmarks