Quite simple actually.
Create actions you want on the menu, and add them in a QActionGroup.
mymeny->addAction(item1);
mymeny->addAction(item2);
mymeny->addAction(item3);
myGroup->addAction(item1);
myGroup->addAction(item2);
myGroup->addAction(item3);
connect(item1, SIGNAL(triggered()), someobject, (SLOT(item1slot()));
connect(item2, SIGNAL(triggered()), someobject, (SLOT(item2slot()));
connect(item3, SIGNAL(triggered()), someobject, (SLOT(item3slot()));
QMenu *mymeny = new QMenu("mymenu");
QAction *item1 = new QAction("item1");
QAction *item2 = new QAction("item2");
QAction *item3 = new QAction("item3");
mymeny->addAction(item1);
mymeny->addAction(item2);
mymeny->addAction(item3);
QActionGroup myGroup = new QActionGroup();
myGroup->addAction(item1);
myGroup->addAction(item2);
myGroup->addAction(item3);
connect(item1, SIGNAL(triggered()), someobject, (SLOT(item1slot()));
connect(item2, SIGNAL(triggered()), someobject, (SLOT(item2slot()));
connect(item3, SIGNAL(triggered()), someobject, (SLOT(item3slot()));
To copy to clipboard, switch view to plain text mode
Remember to add either the actions to a menubar directly, or add the menu to a menubar, depending on the layout you want.
cheers,
Leif
Bookmarks