June 2019
Intermediate to advanced
348 pages
8h 28m
English
Let's proceed with the development. In the preceding section, we built a blank window and now we are going to add the menu bar, toolbar, image display component, and the status bar to the window.
First, instead of using the QMainWindow class, we will define a class ourselves, named MainWindow, which extends the QMainWindow class. Let's see its declaration in mainwindow.h:
class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); private: void initUI(); private: QMenu *fileMenu; QMenu *viewMenu; QToolBar *fileToolBar; QToolBar *viewToolBar; QGraphicsScene *imageScene; QGraphicsView *imageView; QStatusBar *mainStatusBar; QLabel *mainStatusLabel; ...Read now
Unlock full access