[Qt-qml] EaseFollow is now SmoothedAnimation

Leonardo Sobral Cunha leo.cunha at nokia.com
Tue Mar 30 06:03:32 CEST 2010


hi all,

This, 7a060ca401b4e, is a change that might break your existing qml files.

It is not only a rename from EaseFollow to SmoothedAnimation, but also a
behavior change. SmoothedAnimation, as the name states, is an animation :-)
It inherits from NumberAnimaton and as a consequence SmoothedAnimation can
be used inside Behaviors, as PropertySourceValues or in state transitions, 
like any other animation.

The old EaseFollow properties changed to comply with the other declarative 
animations ('source' changed to 'to'), so now 'to' changes are not 
automatically 'followed' anymore.

If you want to follow an hypothetical rect1, you should do now:

     Rectangle {
         color: "green"
         width: 60; height: 60;
         x: rect1.x - 5; y: rect1.y - 5;
         Behavior on x { SmoothedAnimation { velocity: 200 } }
         Behavior on y { SmoothedAnimation { velocity: 200 } }
     }

instead of the old automatic source changed tracking:

     Rectangle {
         color: "green"
         width: 60; height: 60;
         EaseFollow on x { source: rect1.x - 5; velocity: 200 }
         EaseFollow on y { source: rect1.y - 5; velocity: 200 }
    }

At first, it might seem as a change that makes things slightly harder for the
developer, but that at an advantage of consistency to the language as it 
bevahes as all other animations in all places where an animation can be used.

This is pushed in the qml staging branch and should hit 4.7 soon.
Then try to update your apps and report any problems.

The next in line is SpringFollow, which should become SpringAnimation.

cheers,
leo



More information about the Qt-qml mailing list