[Development] Custom QAnimationDriver

Тимур Артиков t.artikov at gmail.com
Mon Apr 14 08:23:22 CEST 2014


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140414/8fb90744/attachment.html>


More information about the Development mailing list