PDA

View Full Version : QPropertyAnimation - how to control the number of animation steps?



Beech
8th April 2010, 09:13
Hi,

I'm wondering if anyone can tell me the best way of controlling the number of animation steps when using QPropertyAnimation? From the help examples:

QPropertyAnimation *animation = new QPropertyAnimation(myWidget, "geometry");
animation->setDuration(10000);
animation->setStartValue(QRect(0, 0, 100, 30));
animation->setEndValue(QRect(250, 250, 100, 30));
animation->start();

With this there is no specification for the number of frames to use. Therefore I cannot see how to influence the cpu overhead of the animation. If I want the animation to use no more than n steps, how should I do it? I have looked at QTimeLine but am not sure how this should (or could) be used with QPropertyAnimation.

Thanks