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 ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.