c++ - In Qt 4.8.5, the differences between setPaused(false) and resume() after setPaused(true) in QTimeLine -


in source of qtimeline.cpp, setpaused(false) , resume() same followd:

d->timerid = starttimer(d->updateinterval); d->starttime = d->currenttime; d->timer.start(); d->setstate(running); 

in docs, setpaused(false) resumes timeline , continues left, resume() resumes timeline current time.
can explain different result "same" code?
read solved topic http://qt-project.org/forums/viewthread/28076 "qtimeline setpaused doesn’t pause time line correctly". still cannot find out reason.

the intention

the intended difference between resume () , setpaused (false) following:

  • resume unconditionally change state of qtimeline running, no matter previous state of was, whereas;

  • setpaused(false) not unless state paused.


the source code

the implementation of setpaused have check see state indeed paused before running code have in question, why "the same code" yields different results.

the below entire body of resume, minor part of definition of setpaused (after bug fix).

d->timerid = starttimer(d->updateinterval); d->starttime = d->currenttime; d->timer.start(); d->setstate(running); 


the previous (buggy) implementation of setpaused (x) had following in branch state == paused, , x == false:

d->timerid = starttimer(d->updateinterval); d->setstate(running); 

where can find more details?

the bug fix talking can inspected in detail under following links:


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -