Make sure the function you need executed is declared as a slot, and connect the Qpopupmenu's activated(int) signal to it and check the int for being the correct item...
Better and more compatible with Qt4 is to use QAction objects which have their own signals per action...
like so
QPopupMenu *fileMenu=new QPopupMenu(this);
fileNewAction->addTo(fileMenu);
connect(fileNewAction,SIGNAL(activated()),this,SLOT(handleFileNew()));
QAction *fileNewAction=new QAction("&New...", QKeySequence("Ctrl+N"),this);
QPopupMenu *fileMenu=new QPopupMenu(this);
fileNewAction->addTo(fileMenu);
connect(fileNewAction,SIGNAL(activated()),this,SLOT(handleFileNew()));
To copy to clipboard, switch view to plain text mode
Bookmarks