Hi David! Thanks for the input! In my case, it was only about how to get a pointer to a menu defined via XML. What Alexander wrote does this very job: auto *someMenu =3D qobject_cast( guiFactory()->container("menuId", this)); (for the XML you wrote, calling this with "foo", would return a pointer to the menu defined via ''. Am Mittwoch, 13. Januar 2021 23:53:20 CET schrieb David Hurka: > 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 >> >> ... > > I probably don=E2=80=99t understand properly what you need. But if you=20 > 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=20 > KActionCollection, set its icon=20 > etc., and populate its menu. > > Of course this moves UI definition from ui.rc to C++ code, but=20 > it looks like=20 > you want to modify the menu at runtime. > > > >