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
Am Mittwoch, 13. Januar 2021, 11:25:18 CET schrieb Thomas Baumgart: > Here's how it is done in KMyMoney (may not be the best way, but it's > working): > > > https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/kmymoney.cpp# > L1270 > > creates all the menus during initialization. The QStringLiterals contain the > names used in the xmlgui.rc file. KMyMoneyApp is derived from KXmlGuiWindow > and thus provides the factory() method. The actions need to exist before > the menu is initialized from what I see. All this is called before > setupGUI() is executed. > > > The context menu can then be executed by e.g. > > lutMenus[Menu::Institution]->exec(QCursor::pos()); > > Hope that helps and gives you some ideas.