Quote:
void QPopupMenu::activated ( int id ) [signal]
This signal is emitted when a menu item is selected; id is the id of the selected item.
Normally, you 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 useful in such cases.
See also highlighted() and QMenuData::insertItem().
Examples: grapher/grapher.cpp, helpviewer/helpwindow.cpp, qdir/qdir.cpp, qwerty/qwerty.cpp, scrollview/scrollview.cpp, and showimg/showimg.cpp.
Just connect to this signal instead of supplying slot names to insertItem() method.