PDA

View Full Version : How to get Qmenu menuitem text



jins
5th December 2010, 16:30
Hi all

Hope someone can help me. I have managed to add a context menu to a listwidget with currentley only one menu item called "Get details"



QAction* menuItem = new QAction("Get details",0);
pop_menu->addAction(menuItem);


What i wanted was something like the below:


If (pop_menu->menuItem->clicked())
{
Do this
}

Is this possible?

wysota
5th December 2010, 17:56
Use signals and slots to connect the action's triggered() signal to a slot you want executed.