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

Painter attributes

Let's start with the attributes. The three most important ones are the pen, brush, and font. The pen holds properties of the outline drawn by the painter, and the brush determines how it will fill shapes. We've already described pens and brushes in Chapter 4Custom 2D Graphics with Graphics View, so you should already understand how to work with them.

The font attribute is an instance of the QFont class. It contains a large number of methods for controlling font parameters such as font family, style (italic or oblique), font weight, and font size (either in points or device-dependent pixels). All the parameters are self-explanatory, so we will not discuss them here in detail. It is important to note that QFont can use ...

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