June 2019
Intermediate to advanced
348 pages
8h 28m
English
Most of the actions we will add in this chapter will be used to edit an image, so we should categorize them in a new menu and toolbar. First, we will declare three members, that is, the edit menu, the edit toolbar, and the blur action, in the private section of the mainwindow.h header file:
QMenu *editMenu; QToolBar *editToolBar; QAction *blurAction;
Then, we will create them in the MainWindow::initUI and MainWindow::createActions methods, respectively, as follows:
In MainWindow::initUI, this is executed as follows:
editMenu = menuBar()->addMenu("&Edit"); editToolBar = addToolBar("Edit");
In MainWindow::createActions, this is executed as follows:
blurAction = new QAction("Blur", this); editMenu->addAction(blurAction); ...Read now
Unlock full access