animation
->setPosAt
(0.0,
QPointF(0,
0));
// animation will move the item to (0,0) at step 0.0 (beginning)animation
->setPosAt
(0.25,
QPointF(1,
1));
// animation will move the item to (1,1) at step 0.25 (25% completed)animation
->setPosAt
(0.5,
QPointF(2,
2));
// animation will move the item to (2,2) at step 0.5 (midway)animation
->setPosAt
(0.75,
QPointF(3,
3));
// animation will move the item to (3,3) at step 0.75 (75% completed)animation
->setPosAt
(1.0,
QPointF(4,
4));
// animation will move the item to (4,4) at step 1.0 (end)
animation->setPosAt(0.0, QPointF(0,0)); // animation will move the item to (0,0) at step 0.0 (beginning)
animation->setPosAt(0.25, QPointF(1,1)); // animation will move the item to (1,1) at step 0.25 (25% completed)
animation->setPosAt(0.5, QPointF(2,2)); // animation will move the item to (2,2) at step 0.5 (midway)
animation->setPosAt(0.75, QPointF(3,3)); // animation will move the item to (3,3) at step 0.75 (75% completed)
animation->setPosAt(1.0, QPointF(4,4)); // animation will move the item to (4,4) at step 1.0 (end)
To copy to clipboard, switch view to plain text mode
How long it will take to reach these steps is up to the attached QTimeLine. GraphicsItemAnimation does not care when these steps are reached. One can even set a certain step by hand via
Bookmarks