Since we have learned so much about the QPainter class and how to use it to display graphics onscreen, I guess it's time for us to do something fun with which we can put our knowledge into practice.
In this recipe, we will learn how to make a basic paint program that allows us to draw lines on a canvas with different brush sizes and colors. We will also learn how to use the QImage class and mouse events in order to construct the paint program.