You should rotate the painter to be exactly in the centre of your item.
painter.save();
painter.translate(x()+width()/2, y()+height()/2);
painter.rotate(rotate);
painter.drawRect(-width()/2, -height()/2, width(), height());
painter.drawText(-width()/2, -height()/2, width(), height(), AlignCenter, text());
painter.restore();
painter.save();
painter.translate(x()+width()/2, y()+height()/2);
painter.rotate(rotate);
painter.drawRect(-width()/2, -height()/2, width(), height());
painter.drawText(-width()/2, -height()/2, width(), height(), AlignCenter, text());
painter.restore();
To copy to clipboard, switch view to plain text mode
BTW. You can get some artifacts if you don't provide a correct (rotated) bounding box for your item.
Bookmarks