The QPopupMenu class provides a popup menu widget. More...
#include <qpopmenu.h>
Inherits QMenuData and QTableView.
The popup widget is different from other widgets in the way it relates to the parent widget.
menu/menu.cpp is a typical example of QMenuBar and QPopupMenu use.
See also: QMenuBar.
Examples: xform/xform.cpp progress/progress.cpp menu/menu.cpp showimg/showimg.cpp layout/layout.cpp widgets/widgets.cpp
Constructs a popup menu with a null parent and a widget name.
A popup menu must be a top level widget, i.e. parent must be 0. This argument is present merely for API uniformity.
Destroys the popup menu.
[signal]
This signal is emitted when a menu item is selected; id is the id of the selected item.
Normally, you will connect each menu item to a single slot using QMenuData::insertItem(), but sometimes you will want to connect several items to a single slot (most often if the user selects from an array). This signal is handy in such cases.
See also: highlighted() and QMenuData::insertItem().
[signal]
For internal use only.
Execute this popup synchronously.
The return code is the ID of the selected item, or -1 if no item is selected (normally because the user presses Escape).
Note that all signals are emitted as usual. If you connect a menu item to a slot and call the menu's exec(), you get the result both via the signal-slot connection and in the return value of exec().
[virtual]
Reimplements QWidget::hide() for internal purposes.
Reimplemented from QWidget.
[signal]
This signal is emitted when a menu item is highlighted; id is the id of the highlighted item.
Normally, you will connect each menu item to a single slot using QMenuData::insertItem(), but sometimes you will want to connect several items to a single slot (most often if the user selects from an array). This signal is handy in such cases.
See also: activated() and QMenuData::insertItem().
[signal]
For internal use only.
Returns whether display of check marks by the menu items is enabled.
See also: setCheckable() and QMenuData::setItemChecked().
[virtual protected]
Handles key press events for the popup menu.
Reimplemented from QWidget.
[virtual protected]
Handles mouse move events for the popup menu.
Reimplemented from QWidget.
[virtual protected]
Handles mouse press events for the popup menu.
Reimplemented from QWidget.
[virtual protected]
Handles mouse release events for the popup menu.
Reimplemented from QWidget.
[virtual protected]
Handles paint events for the popup menu.
Reimplemented from QWidget.
Opens the popup menu so that the item number indexAtPoint will be at the specified global position pos. To translate a widget's local coordinates into global coordinates, use QWidget::mapToGlobal().
Sets the currently active item to i and repaints as necessary.
Enables or disables display of check marks by the menu items.
Notice that checking is always enabled when in windows-style.
See also: isCheckable() and QMenuData::setItemChecked().
Examples: progress/progress.cpp
[virtual]
Reimplements QWidget::setFont() to be able to refresh the popup menu when its font changes.
Reimplemented from QWidget.
[virtual]
Reimplements QWidget::show() for internal purposes.
Reimplemented from QWidget.
[virtual protected]
Handles timer events for the popup menu.
Reimplemented from QObject.
This file is part of the Qt toolkit, copyright © 1995-97 Troll Tech, all rights reserved.
It was generated from the following files: