I need to draw the text rotated 45 degrees on the image. I use QPainter. That is method rotate. I do painter.rotate(45) , but my text completely disappears from it. Pen and Font asked (opaque color), I now painter.drawText(500, 2000, 'Hello world!') even the simplest overload painter.drawText(500, 2000, 'Hello world!') And the image is empty ... And without the rotate call, everything works fine. Where is the catch?
upd. I found the trick: the text just went beyond the borders of the image. Due to the fact that the painter is rotated, the coordinate system seems to change ... In this case, the question is: how can I recalculate the coordinates so that they are approximately in the same place (although the text is rotated, well, at least it would start from the same place)?