I'v set up an animation like this:
animate = new QPropertyAnimation(this,"geometry");
animate->setDuration(800);
QEasingCurve curve = QEasingCurve::OutBack;
curve.setOvershoot(1.5);
animate->setEasingCurve(curve);
connect(animate,SIGNAL(finished()),this,SLOT(finishedGeometryAnimation()));
animate = new QPropertyAnimation(this,"geometry");
animate->setDuration(800);
QEasingCurve curve = QEasingCurve::OutBack;
curve.setOvershoot(1.5);
animate->setEasingCurve(curve);
connect(animate,SIGNAL(finished()),this,SLOT(finishedGeometryAnimation()));
To copy to clipboard, switch view to plain text mode
The startValue and endValue are changed prior to each call to start()
It all works fine for a while. Then the animation just stops animating.
According the to object it is running, the state says it is running, but the currentTime never changes from 0 and it also never sends a finished signal.
Is there something I'm missing with animations?
To work around this problem I've set up a timer with a duration slightly longer than the animation. If the animation hasn't completed then I force the action I want (move or close). Stop the animation. And call setParent on the animation using the timer event. The next time I call start it animates fine again.
I also am unable to see any consistence in my testing, sometimes it stops working after six animations, sometimes after an hour of testing.
Any pointers to what I am doing wrong will be much appreciated.
Added after 6 minutes:
Actually, the setParent seems to have stopped working as a solution now.
Bookmarks