PDA

View Full Version : Rotating a QGraphicsProxyWidget



Luc4
14th April 2010, 17:22
Hi! I subclassed QGraphicsProxyWidget to create an item where I put a label. I need to resize this item and to rotate it. I can rotate and resize it correctly. But... how do I write the boundingRect() method so that I get the correct rect after resize and rotate? I really can't make the method return the correct rect after rotation...
Thanks!

Luc4
15th April 2010, 14:11
In case anyone else need this, I found out it was necessary to use sceneBoundingRect(), which returns exactly what I wanted, i.e. the boundingRect after applying the transformations set for the item.

qlands
16th June 2010, 12:59
Hi,

I'm trying to follow your advice on this but it is not clear to me how to do it.

Can you post some bits of code?

Many thanks,
Carlos.

Luc4
16th June 2010, 13:53
There's no code to post as far as I can remember. You only have to override boundingRect() correctly and then you can call the method sceneBoundingRect() to get the bounding rect resulting after the transformations you applied.