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

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

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