PDA

View Full Version : Bend QGraphicsItem animation



mvbhavsar
14th September 2011, 08:08
Hi,

I am developing application which involves QGraphicsItem animation using QPropertyAnimation.
As per application requirement, I have to bend QGraphicsRectItem's one end to certain degree using animation. What is the mechanism available to bend QGraphicsItem. Pl. find attached picture for reference.


Thanks

Manish

wysota
14th September 2011, 08:31
If you can do the bending yourself then you can use QGraphicsTransform to modify any graphics item. Other than that it might be easier to implement your own graphics item from scratch.

mvbhavsar
14th September 2011, 10:35
Thanks wysota,

I am not sure about how to bend it. QGraphicsTransform do not have anything to bend it.
Any clue which will help me to bend rectangle box will be appreciated.


Thanks

Manish

wysota
14th September 2011, 12:18
If you want to use QGraphicsTransform then you need to do proper maths and do the bending yourself. There is no QGraphicsBendMyItemInAnArbitraryPlaceTransform class that you can just take and use. If you just want an item with a rounded corner then use QGraphicsPathItem and compose the path of two lines connected with an arc.