From kde-devel Wed Jan 13 22:53:20 2021 From: David Hurka Date: Wed, 13 Jan 2021 22:53:20 +0000 To: kde-devel Subject: Re: Accessing a (sub)menu defined in an XmlGui ui.rc file Message-Id: <2181300.ElGaqSPkdT () doro> X-MARC-Message: https://marc.info/?l=kde-devel&m=161057843015658 On Wednesday, January 13, 2021 10:39:48 AM CET Tobias Leupold wrote: > Hi list :-) >=20 > I have a problem with a KXmlGuiWindow and I honestly can't find respective > docs or howtos/tutorials. I hope someone here can help me ... I faced the same problem... :( > It's a allegedly basic task: How can I access a submenu (or better: a > submenu's QAction) for a menu defined in a ...ui.rc file? >=20 > If I define the submenu like so: >=20 > > > > Some text > > > > I probably don=E2=80=99t understand properly what you need. But if you want= to modify=20 the action which contains the menu "bar", you could use KActionMenu. Change the ui.rc to: then create a KActionMenu called "bar" in your KActionCollection, set its i= con=20 etc., and populate its menu. Of course this moves UI definition from ui.rc to C++ code, but it looks lik= e=20 you want to modify the menu at runtime.