I have a list of QActions, some are added to the top level menu and few are added to submenus of top level.
Is there any way to know parent menu name of each actions?
You can check if the result of act->parentWidget()
if it is a valid pointer, if so you can manipulate as a normal widget.
To get the menu name, it depends on which widget you are using.
If is QMenu, you can retrieve the menu title via the title function.
QAction *act;
...
QWidget *widget = act->parentWidget();
if (widget) {
QMenu *menu = dynamic_cast<QMenu*>(widget);
menu->title();
}