jano_alex_es
22nd October 2009, 16:26
Hi,
I have a QGraphicsPixmapItem on an Scene, I need to rotate it.
float xx= this->pixmap().width() / 2;
float yy= this->pixmap().height() / 2;
setTransform(QTransform().translate(xx,yy).rotate( m_iAngle).translate(-xx, -yy));
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 .
I have a QGraphicsPixmapItem on an Scene, I need to rotate it.
float xx= this->pixmap().width() / 2;
float yy= this->pixmap().height() / 2;
setTransform(QTransform().translate(xx,yy).rotate( m_iAngle).translate(-xx, -yy));
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 .