I have implemented the following code
QRectF rect
(0,
0, height
(), Margin
);
painter->save();
painter->translate(50,0);
painter->rotate(90);
painter->drawText(rect,Qt::AlignCenter | Qt::AlignTop,str);
strBoundingRect = painter->boundingRect(rect,Qt::AlignCenter,str);
painter->restore();
QRectF rect(0, 0, height(), Margin);
painter->save();
painter->translate(50,0);
painter->rotate(90);
painter->drawText(rect,Qt::AlignCenter | Qt::AlignTop,str);
strBoundingRect = painter->boundingRect(rect,Qt::AlignCenter,str);
painter->restore();
To copy to clipboard, switch view to plain text mode
However, using the above code return in strBoundingRect the initial bounding rectangle of the QString str and not the one that corresponds to the rotated and translated painter.
Can you give me an example on how can I obtain the bounding rectangle taking also into account both translation and rotation?
Thanks in advance...
Bookmarks