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

Raster painting

When we talk about GUI frameworks, raster painting is usually associated with drawing on widgets. However, since Qt is something more than a GUI toolkit, the scope of raster painting that it offers is much broader.

In general, Qt's drawing architecture consists of three parts. The most important part is the device the drawing takes place on, represented by the QPaintDevice class. Qt provides a number of paint device subclasses, such as QWidget or QImage and QPrinter or QPdfWriter. You can see that the approach for drawing on a widget and printing on a printer is quite the same. The difference is in the second component of the architecture—the paint engine (QPaintEngine). The engine is responsible for performing the actual ...

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