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

What just happened?

An animation was attached to the color property of our rectangle modeling the visual aspects of the sun. The animation consists of three parts. First, we perform a transition from red to yellow using the ColorAnimation object. This is an Animation subtype dedicated to modifying colors. Since the rectangle color is not a number, using the NumberAnimation object will not work, as the type cannot interpolate color values. Therefore, we either have to use the PropertyAnimation or the  ColorAnimation  object. The duration for the animation is set to 20 percent of half the day length so that the yellow color is obtained very quickly. The second component is a PauseAnimation object to provide a delay before the third component ...

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