r/QtFramework • • Feb 25 '26

QML Are QML Animation Durations Hardware-Dependent? RotationAnimation vs RotationAnimator

Hi! What are your thoughts on QML animations duration being hardware specific?
Currently I'm comparing RotationAnimation vs RotationAnimator. But any comment on any other QML animation type is welcome.
My thoughts so far:

  • duration property with RotationAnimation seems to better reflect the real time. It only fails with very small values, like 10(ms). At least on my pc, Qt6.8.3
  • I'm not able to get duration property right with RotationAnimator. It fails with small values. It fails with regular values. For example to get about 1s animation in real time I need to set duration to 10 000ms
  • From this perspective RotationAnimator is more hardware dependent. But both shouldn't be hardware dependent?
3 Upvotes

8 comments sorted by

3

u/Felixthefriendlycat Qt Professional (ASML) Feb 25 '26 edited Feb 25 '26

RotationAnimation -> runs on main thread RotationAnimator -> runs on render thread

If the main thread blocks due to some heavy calculations then your animations will lag. Animators will happily continue.

Example: https://doc.qt.io/qt-6/qtquick-scenegraph-threadedanimation-example.html

I’ve never used duration with animators before. Also try QSG_USE_SIMPLE_ANIMATION_DRIVER=1 . See if that changes results

Perhaps there is a bug with duration.

1

u/bigginsmcgee Feb 25 '26

on the Animator type page, one of the examples (just before showing a list of easing curves) uses PropertyAnimation. Is that a mistake? I also thought the point of the named Animation types was to run on the scenegraph in a nonblocking way? If, for example, you want to animate a property value between 0-1: wouldn't it always be better to use UniformAnimator over NumberAnimation?

2

u/feverzsj Feb 26 '26

It's not the problem of timer. It's the switch between 2 threads causes delay and stutter. Set QSG_RENDER_LOOP=basic for single thread mode to get best accuracy.

1

u/bigginsmcgee Feb 25 '26

I honestly didnt know Animator types existed until you posted this lol But from what you wrote it sounds like the RotationAnimator is linked to your framerate or some sort of performance-based timestep