[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Accessing a (sub)menu defined in an XmlGui ui.rc file
From:       Tobias Leupold <tobias.leupold () gmx ! de>
Date:       2021-01-13 10:50:50
Message-ID: 6288488.4vTCxPXJkl () ginuog
[Download RAW message or body]

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.c=
pp#
> L1270
>
> creates all the menus during initialization. The QStringLiterals contain=
 the
> names used in the xmlgui.rc file. KMyMoneyApp is derived from KXmlGuiWin=
dow
> 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.




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic