O'Reilly logo

An Introduction to Design Patterns in C++ with Qt™, Second Edition by Paul Ezust, Alan Ezust

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

Chapter 10: Main Windows and Actions

Most QApplications manage a single QMainWindow. As Figure 10.1 shows, the QMainWindow has some features that are common to most desktop applications:

• Central widget

• Menu bar

• Toolbars

• Status bar

• Dock regions

Figure 10.1 A Main Window

image

In most applications, the QMainWindow is the (grand)parent object of all QAction, QWidget, and QObject heap objects. It is common practice to extend that class for applications, as shown in Example 10.1.

Example 10.1 src/widgets/mainwindow/mymainwindow.h

image

10.1 QActions, ...

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