Creating a paint program
In the following section, we will move over to the realm of pixels and learn how to create a paint program using Qt. Users will be able to express their creativity by using different sizes and colors of the brush to draw pixel images!
Setting up a user interface
Again, for this example, we will create a new Qt Widget Application.
After that, open up mainwindow.ui
and add a menu bar to the main window. Then, add the following options to the menu bar:

We have three menu items on the menu bar—File
, Brush Size
, and Brush Color
. Under the File
menu are functions for saving the canvas into a bitmap file, as well as clearing the entire canvas. The Brush Size
category contains different options for the brush size; last but not least, the Brush Color
category contains several options for setting the brush color.
You can go for something more paint-like or Photoshop-like for the GUI design, but we will use this for now for the sake of simplicity.
Once you're done with all that...