Hello all,
I am fighting with a problem regarding mapping a rectangle which is not of
QRect type. I want to rotate the rectangle 90 degree counterclockwise and
I just did it as follow but the result is not what I want.Instead the rectangle
gets larger in size. Can someone give me suggestions how to solve this problem?
QWMatrix matrixWorld;
double rotateDegree = 90.0;
newRect.setRect(myRect.Left(), myRect.Top(), myRect.Width(), myRect.Height());
matrixWorld.rotate(rotateDegree);
newRect = matrixWorld.mapRect(newRect);
myRect.Rect(newRect.left(), newRect.top(), newRect.width(), newRect.height());
QWMatrix matrixWorld;
QRect newRect;
double rotateDegree = 90.0;
newRect.setRect(myRect.Left(), myRect.Top(), myRect.Width(), myRect.Height());
matrixWorld.rotate(rotateDegree);
newRect = matrixWorld.mapRect(newRect);
myRect.Rect(newRect.left(), newRect.top(), newRect.width(), newRect.height());
To copy to clipboard, switch view to plain text mode
Bookmarks