O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Main menu and toolbars

As you may remember, any widget that has no parent will be displayed as a window. However, when we created our main window, we selected QMainWindow as the base class. If we had selected QWidget instead, we would still be able to do everything we did up to this point. However, the QMainWindow class provides some unique functionality that we will now use.

A main window represents the control center of an application. It can contain menus, toolbars, docking widgets, a status bar, and the central widget that contains the main content of the window, as shown in the following diagram:

If you open the mainwindow.ui file and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required