views:

121

answers:

1

hello
is there any way to get the selected item in a qmenu ?
i want to bind all items in that list to one function and get the item once user click it . i've been looking for a way to get the item's label or index for 3 days , but couldn't find it . any ideas ?

thanks in advance

+1  A: 

You can achieve this with signals.

Connect all triggered slots of your menu items to your function. Then, in this function, use the static function QObject::sender to retrieve the menu item which has sent the signal.

Patrice Bernassola