Once you have the main QAction, it has a menu() method, which in turn has an actions() method.

So for instance:
 bar = foo->menu()->actions().at(0).

Of course with much more logic to check that every item exists and not hardcoding the position, but I hope you get the point.

El mié., 13 ene. 2021 14:24, Thomas Baumgart <thb@net-bembel.de> escribió:
On Mittwoch, 13. Januar 2021 11:50:50 CET Tobias Leupold wrote:

> Hi Thomas!
>
> Thanks for this info, but this is about context menus ... I want to access a
> submenu inside a menu of the main menu bar ... such as the "File" -->
> "Recently used" menu of KWrite or such

Ooops, my bad, or as we say in German "Thema verfehlt, setzen, sechs" :)

--

Regards

Thomas Baumgart

https://www.signal.org/       Signal, the better WhatsApp
-------------------------------------------------------------
The shortest words, namely yes and no,
require the most thoughts. -- Pythagoras of Samos
-------------------------------------------------------------