This article is for beginner, who want to create menu using push-button tool available in Qt. Useful code example is given in which user can change and try something different.
Also output is shown graphically, which is must important in this kind of article...
This article creates a menu in different style. When a button is pressed, a menu is created. To accomplish this task, mainly QPushButton and QMenu are used. QPushButton API is for Button and QMenu Creates a menu when a Button is pressed, here in this case Menu Button is pressed.
This article represents some basic code and APIs that will definitely help to beginners. --Vkmunjpara 21:52, 25 September 2009 (UTC)
Usually menus in Qt can be created using QMenuBar class. If application is derived from QMainWindow class then it has method, called menuBar(), which return the menu bar for the main window, otherwise you need to create and add menu using QMenuBar class.
A Pop-up menu is a menu in a GUI application that appears upon user interaction, such as a touch on some part of widget. It can be created by using QMenu class which provides a menu widget for use in menu bars. QPushButton::setMenu() associate menu widget with QPushButton, and thus create pop-up menu. Usually pop-up menu is useful to show menu on clicking some part of widget. pop-up menu can also be created on some other events, QPushButton is not only the way to create pop-up menu.
Article describes the way to create popup menu using QPushButton. Althogh article have less explanation the code is useful to beginners to crate pop-up menu.
--kamlesh sangani 11:43, 26 September 2009 (UTC)