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
You can achieve this with signals.
Connect all
triggeredslots of your menu items to your function. Then, in this function, use the static functionQObject::senderto retrieve the menu item which has sent the signal.