O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Property value sources

From the QML perspective, Animation and element types derived from it are called property value sources. This means they can be attached to a property and generate values for it. What is important is that it allows us to use animations using a much simpler syntax. Instead of explicitly declaring the target and property of an animation, you can attach the animation to a named property of the parent object.

To do this, instead of specifying target and property for Animation, use the on keyword, followed by the name of a property name for which the animation is to be a value source. For example, to animate the rotation property of an object with a NumberAnimation object, the following code can be used:

NumberAnimation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required