did you see this signal QMenu::triggered.
an example
...
QMenu *menu
= menuBar
()->addMenu
("Test");
menu->addAction(action);
menu->addAction(action);
menu->addAction(action);
menu->addAction(action);
menu->addAction(action);
connect(menu,
SIGNAL(triggered
(QAction *)),
SLOT(processAction
(QAction *)));
...
...
QMenu *menu = menuBar()->addMenu("Test");
QAction *action = new QAction("1", this);
menu->addAction(action);
action = new QAction("2", this);
menu->addAction(action);
action = new QAction("3", this);
menu->addAction(action);
action = new QAction("4", this);
menu->addAction(action);
action = new QAction("5", this);
menu->addAction(action);
connect(menu, SIGNAL(triggered(QAction *)), SLOT(processAction(QAction *)));
...
To copy to clipboard, switch view to plain text mode
Bookmarks