void drawRotateText(QPainter *painter, float degrees, int x, int y, int w, int h, int flags, const QString &text, QRect *br=0){ painter->save(); painter->translate(x, y); painter->rotate(degrees); painter->drawText(0, 0, w, h, flags, text, br); painter->restore();}
C++ (Qt) painter->save(); painter->setTransform(QTransform() .translate(r.width() / 2, r.height() / 2) .rotate(30, Qt::XAxis) .rotate(10, Qt::YAxis) .rotate(5, Qt::ZAxis) .scale(0.1 , 0.1) .translate(-r.width() / 2, -r.height() / 2)); painter->drawText(0, 0, w, h, flags, text, br); painter->restore();