Hi Alexander :-) This actually works! It has to be done after having called setupGUI(), jus= t to notice this, otherwise, one still gets a nullptr. What I did in the example I wrote before: #include #include ... setupGUI(Keys | Save | Create, "demoui.rc"); auto *guiFactory =3D this->guiFactory(); auto *subMenu =3D dynamic_cast( guiFactory->container("subMenu", this)); subMenu->menuAction()->setIcon(QIcon::fromTheme("document-save-all")); ... I really tried hard to read the docs. And I really searched! But honestly, there's no way to grasp this (for somebody not having worked with this for ages or so). This should be either mentioned somewhere in a tutorial/howto= or some more intuitive way to get a menu pointer should be available imo ... At least, the mailing list archive now knows this, so that possibly, one w= ill be able to find this when googling it later. Thanks a lot :-) Tobias Am Mittwoch, 13. Januar 2021, 21:18:57 CET schrieben Sie: > Hi Tobias, > > > I have a problem with a KXmlGuiWindow and I honestly can't find respec= tive > > docs or howtos/tutorials. I hope someone here can help me ... > > [...] > > But how can I get the "bar" QMenu (or it's respective QAction)? So tha= t I > > can > > e. g. disable or hide the menu, or assign an icon? For manually define= d > > menus, > > In your main window class deriving from KXMLGuiWindow you do the followi= ng: > > auto* factory =3D this->guiFactory(); > auto* menu =3D dynamic_cast(factory->container("bar", this)); > if (menu) { > //add your logic here with the menu pointer > } > > Is this what you're looking for? > > -- > Alexander