[Development] Custom QAnimationDriver

Gunnar Sletta gunnar.sletta at jolla.com
Tue Apr 15 07:59:07 CEST 2014


On 14 Apr 2014, at 08:23, Тимур Артиков <t.artikov at gmail.com> wrote:

> Hi Gunnar,
> In my case the current time of animations should be controlled by a video output device, and this time is not equals to real time (QUnifiedTimer::time.elapsed()).
> The QSG_FIXED_ANIMATION_STEP option is also not acceptable. I can't suppose that rendering performance is stable, and in the case of a "slow frame" the next frame should has 
> greater time delta.
> 
> The only acceptable option for me is manually control the time of animations (set it equals to the current time of the video output device).
> The custom QAnimationDriver, as I supposed, is the way to do it (by overloading QAnimationDriver::advance and QAnimationDriver::elapsed). 
> But it does not works, because in some cases Qt uses time from QUnifiedTimer::time.elapsed() and not QAnimationDriver::elapsed().
> 
> I tried replace time.elapsed() to driver->elapsed() in QUnifiedTimer::updateAnimationTimers method, and it seems to solve my issue.
> May be such changes should be done in the Qt source code?

If you have a bugfix, the please provide it through https://codereview.qt-project.org/ :)


More information about the Development mailing list