There are two methods currently found, as follows:
1, the use of qpixmap transformed function rotation, the function by default is the image Center for the rotation point, not arbitrarily set the rotation point, using the following:
Qmatrix Leftmatrix;
Leftmatrix.rotate (180);
Qlabel *plabel= new Qlabel ();
Plabel->setpixmap (Qpixmap (":/images/img.png"). Transformed (leftmatrix,qt::smoothtransformation));
The result is a 180 degree rotation of the clockwise meter.
2. Using Qpainter class
void Dialog::p aintevent (qpaintevent *)
{
qpainter painter (this);
QPIXMAP pix;
Pix.load ("Images/img.png");
Painter.translate (50,50); Make the center of the picture the center of the rotation
Painter.rotate (90); Rotate clockwise 90 degrees
Painter.translate ( -50,-50); Restore the origin.
Painter.drawpixmap (0,0,100,100,pix);
}
http://blog.csdn.net/itjobtxq/article/details/9231103
Qt Picture rotation