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?

The first set of changes introduced four new properties defining four colors that we later used in statements defining gradient and text colors for the button. In QML, you can define new properties for objects with the property keyword. The keyword should be followed by the property type and property name. QML understands many property types, the most common being int, real, string, font, and color. Property definitions can contain an optional default value for the property, preceded with a colon. The situation is different with the pressed property definition.

You can see that for the property type, the definition contains the word alias. It is not a property type but an indicator that the property is really an alias ...

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