We've already seen that Qt provides a vast array of widgets with extensive styling and customization capabilities. There are times, however, when we need to take direct control of what is being drawn on the screen; for example, we might like to edit an image, create a unique widget, or build an interactive animation. At the core of all these tasks in Qt sits a humble, hardworking object known as QPainter.
In this chapter, we're going to explore Qt's two-dimensional (2D) graphics capabilities in three sections:
- Image editing with QPainter
- Custom widgets with QPainter
- Animating 2D graphics with QGraphicsScene