qt - The use of setFrameRange method -
what use of setframerange method (which part of qtimeline class)? found example:
qgraphicsitem *ball = new qgraphicsellipseitem(0, 0, 20, 20); qtimeline *timer = new qtimeline(5000); timer->setframerange(0, 100); qgraphicsitemanimation *animation = new qgraphicsitemanimation; animation->setitem(ball); animation->settimeline(timer); (int = 0; < 200; ++i) animation->setposat(i / 200.0, qpointf(i, i)); qgraphicsscene *scene = new qgraphicsscene(); scene->setscenerect(0, 0, 250, 250); scene->additem(ball); qgraphicsview *view = new qgraphicsview(scene); view->show(); timer->start();
obviously seems work noticed modifying parameter doesn't change thing. tried write sth this:
- timer->setframerange(100, 100)
- timer->setframerage(0,0)
but despite of i'm doing result still same.
to sum up, have 2 questions. method doing (and yes, i've read documentation), , why modifications doesn't change anything?
as you've read documentation, you'll have noticed states can used calling currentframe() or framefortime(). therefore, sets relationship of timeline frames. you're not calling either of functions, it's doing nothing!
i guess setting frame 0 100, means asking current frame @ 2.5 seconds (with time line of 5000), 50, whereas setting start , end frame 0 - 50, 25. going related calling framechanged(int frame) if you're interested in getting notified when particular frame has been reached.
to summarise, allows reference animation in frames, using interpolation between minimum , maximum values want use.
Comments
Post a Comment