[PyQt] Why can I rotate a GraphicsItem only once?

Konrad Koller koko9991 at googlemail.com
Sun Aug 1 09:45:16 BST 2010


Konrad wrote: In a game the user should be able to rotate a GraphicsItem by
clicking on it with the right mouse button. According the game situation he
must be able to execute another rotation by the same angle (90°). But this
time the item is not rotated!

Philippe Crave answered:
seems that setRotation() sets an absolute value, not an increment.
if you want to add 90°, you should do something like
self.setRotation(self.rotation()+90)

Konrad writes:
This is the solution. Many thanks to Philippe for his answer!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100801/4823aa6b/attachment-0001.html>


More information about the PyQt mailing list