I am trying to walk the tree of menus in my application. The main window has a QMenuBar, through the actions of this object I can iterate through the menus in the menubar and so on.

The problem I am having is trying to work out whether an action is a QMenu or a simple action.

is there are a way to work out when you have an action to decide whether that is QMenu or not.

What I am trying to do is to create a function which inserts a menu item at a particular location (e.g. addMenuItem("&File/&Recent Projects", pMyProjectAction), this needs to find the File menu and then the recents projects menu and then add the new action to it). The problem I am having is how to get a QMenu so I can add the new item to it, all I have are the actions with the "&File" menu.