Chapter 3. Main Windows and Layout Management
In the previous chapter, we saw how to create windows using widgets. Most of the GUI applications that we use today are main window-styled applications, which have a menu bar, toolbars, a status bar, a central widget, and optional dock widgets. Generally, an application will have a single main window and a collection of dialogs and widgets to serve the purpose of the application. A main window provides a framework to build an application's user interface. In this chapter, we shall discuss the creation of a main window application with its predefined components. We will also discuss layout management in a windowed application.
PySide provides a class, named PySide.QtGui.QMainWindow
, that is derived from QWidget
and its related classes for main-window management. QMainWindow
has its own layout to which you can add toolbars, a menu bar, a status bar, dock widgets, and a central widget. The layout description of a main window is as...