Images can be edited in Qt using a QPainter object to draw on a QImage object. In Chapter 6, Styling Qt Applications, you learned about the QPixmap object, which is a display-optimized object representing a graphical image. The QImage object is a similar object, which is optimized for editing rather than display. To demonstrate how we can draw on a QImage object using QPainter, we're going to build a classic meme generator application.
Image editing with QPainter
The meme generator GUI
Create a copy of your Qt application template from Chapter 4, Building Applications with QMainWindow, and call it meme_gen.py. We will begin by building the GUI form for our meme generator.