Please post some compilable code demonstrating the problem. What you posted looks ok and in general should work, provided you call setGridPos() correctly.
@d_stranz: animating a point is not a problem, Qt knows how to do that.
Please post some compilable code demonstrating the problem. What you posted looks ok and in general should work, provided you call setGridPos() correctly.
@d_stranz: animating a point is not a problem, Qt knows how to do that.
d_stranz (7th January 2013)
So I guess the default easing curve for moving from point A to point B is linear? - Divide delta x and delta x by the time and move each incrementally by the appropriate amount at each step?animating a point is not a problem, Qt knows how to do that
I don't see where QAbstractAnimation or its derived classes offer any control over the step size (time increment), only the duration of the animation. QEasingCurve allows control of the rate (i.e acceleration) of increment, but not of the increment itself. Is there a way to specify, f.e. that you want an animation that lasts for 5 seconds, and requires 10 steps? (I mean, maybe for some silly reason, you might want a jerky animation. Maybe you are trying to simulate an old silent movie).
(Looking at QEasingCurve, I suppose you could override the QEasingFunction::customType method to achieve a "jerky" motion by returning the same value for some range of progress values).
Last edited by d_stranz; 7th January 2013 at 06:34.
The default easing curve is always linear. What's important is that QVariantAnimation knows how to interpolate a QPoint.
They don't.I don't see where QAbstractAnimation or its derived classes offer any control over the step size (time increment),
No.Is there a way to specify, f.e. that you want an animation that lasts for 5 seconds, and requires 10 steps?
In that case use a simple QTimer. Alternatively you might implement a custom easing curve but I don't think it is worth it.(I mean, maybe for some silly reason, you might want a jerky animation. Maybe you are trying to simulate an old silent movie).
d_stranz (7th January 2013)
Bookmarks