I would like to display an animated arrow shape button.
To draw it, I creat a class which inheriths QGraphicsObject
and use the QPainterPath
class.
I draw it in a QGraphicsScene
and animate it using the property geometry
, re defined in MyArrow class.
You can find all the code here : https://github.com/TaiZzZ/arrowAnimation
My issue is the following :
The arrow animates (meaning it moves right and comes back) but stays painted while moving. Do you have any idea why ?
Ps : I have the same behaviour using QState Machine, so I'm guessing the issue comes only from the way I draw my arrows.
I tried two different things :
Changing the bezier curve into line, it doesn't fix the problem.
Instead of drawing the path, I drew a rectangle(the
boundingRect()
) (So I only changeddrawPath(path)
), and it works
So to conclude, the bug comes from QPainterPath ... but why ?
EDIT :
Here are pictures to illustrate my problem :
Note that it is no longer anti-alliased...