PDA

View Full Version : QGraphicsItem independent of scene transformation



wagmare
9th January 2012, 09:53
Hi,

Can any one help me of painting a QGraphicsItem which should not change when the QGraphicsScene changes its rect() ..

ex:
i want to increace the size of the QGraphicsScene rect ... but one particular QGraphicsItem (currently i customize it ..) should not change ..


cna any one please help me ..

Thanks in advance ..... !!

wysota
9th January 2012, 10:44
What do you mean that it should not change? How does it change?

wagmare
19th January 2012, 05:19
thanks wysota ...
actually i want to ignore the transformation of item in scene ...
i used ignore transformation flag in the graphicsItem...

Added after 5 minutes:

and im having the problem that .. if i try to rotate my graphicsItem ... it is shifting a little in y() also ...

Ex:
i tried to rotate a graphicsItem like a pendulum ...
i tried
item->setRotation(10);

but when it rotates it add its y() coordinates .. it is not rotating in constant axis ....

i need some suggestion ...

please help me ..

Thanks in advance ..

Lykurg
19th January 2012, 06:56
see QGraphicsItem::setTransformOriginPoint() and the flag QGraphicsItem::ItemIgnoresTransformations.

wagmare
19th January 2012, 08:47
Thanks Lykurg ... this i want ... i will give u the result soon ....