Let's start our fun project through the following steps:
- Again, we start by creating a new Qt Widgets Application project and removing the tool bar and status bar. We will keep the menu bar this time.
- After that, set up the menu bar like so:
- We will leave the menu bar as it is for the moment, so let's proceed to the mainwindow.h file. First, include the following header files, as they are required for the project:
#include <QPainter>#include <QMouseEvent>#include <QFileDialog>
- Next, declare the variables that we'll be using for this project, like so:
private: Ui::MainWindow *ui; QImage image; bool drawing; QPoint lastPoint; ...