We will now add the menu bar to our application. We use the class
PySide.QtGui.QMenuBar for creating a menu bar. This class provides a horizontal menu bar to which the menu items can be added. You don't have to set a layout for menu bar. Different platforms use different layouts for the menu bar. In Windows system, the menu bar is usually anchored at the top of a window under the title bar. In the Macintosh system, the menu bar is usually anchored at the top of the screen. Linux systems have both these display formats depending on the GUI style.
QMenuBar automatically sets its own geometry to the top of the parent widget and changes it appropriately whenever the parent is resized.
In the main window style applications, we use ...