Game Programming using Qt 5 Beginner's Guide - Second Edition
by Pavel Strakhov, Witold Wysota, Lorenz Haas
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access