O'Reilly logo

PySide GUI Application Development by Venkateshwaran Loganathan

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

Adding menus

Once the menu bar is set, menu list can be added to it. The PySide.QtGui.QMenu class provides menu widget for use in menu bars, context menus, and other popup menus. A menu widget is a selection menu. It can be either a pull-down menu in a menu bar or can be a context menu. Pull-down menus are shown by the menu bar when the user clicks on the respective item or presses the specified shortcut key. Context menus are invoked by some special keyboard key or by right-clicking on it.

In the menu bar, we add menus with the function QMenuBar.addMenu(menu). For the example application, we add three menus namely, File, Edit, and About. Inside each of these menus, we create two actions each that when triggered by click or a keyboard shortcut ...

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