Hello, I want to rotate the pixmap of the QGraphicsPixmap item and show the item rotated. Rotating the item cause other sort of problems.

So far, I never had problems when rotating the pixmaps, but I don't know why now the rotation is not taking from the center and rotates the pixmap, it's like its rotated without the translation and I don't know why.

Qt Code:
  1. //m_pxOriginal is a copy of the original pixmap. Not rotated.
  2. qreal rRadius = m_pxOriginal.width() / 2;
  3.  
  4. //Rotate the previous rotation - 10 degrees
  5. m_iAngle -= 10;
  6.  
  7. QPixmap rotatedPix = m_pxOriginal .transformed(QTransform().translate(-rRadius, -rRadius).rotate(m_iAngle).translate(rRadius, rRadius));
  8.  
  9. m_pxItem->setPixmap(rotatedPix);
To copy to clipboard, switch view to plain text mode 

Anything strange? :S thanks!