Hi,

I have a QGraphicsPixmapItem on an Scene, I need to rotate it.

Qt Code:
  1. float xx= this->pixmap().width() / 2;
  2. float yy= this->pixmap().height() / 2;
  3. setTransform(QTransform().translate(xx,yy).rotate(m_iAngle).translate(-xx, -yy));
To copy to clipboard, switch view to plain text mode 


My application has the option to export the ScenePos of the item into an XML file.

Everything goes right if I don't rotate the item, but if we have an item, we rotate it, we write its scenePos in the xml file and we read the xml file its position on the screen has changed.

My app first reads the xml file, then it creates a new item, it sets the pos and rotate later, but if I create it first, rotate it later and after all set the pos the result is the same :S The item moves itself magically .