Toolbar
Beneath the menu bar is a panel that is usually referred to as toolbar. It contains a set of controls that could be widgets or instances of QAction, just as we saw in their use in creating the menu bar. This also means that you may choose to replace the QAction with a widget, such as a regular QPushButton or QComboBox.
Toolbars may be fixed to the top of the window (beneath the menu bar) and can be pinned there or made to float around the dock widget.
Once again, we will need to create a new project or modify the one from the previous section of this chapter. The files that we will be creating are main.cpp, mainwindow.h, and mainwindow.cpp.
The main.cpp file remains the same, as follows. We only instantiate our custom class and call ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access