From kde-devel Wed Jan 13 20:18:57 2021 From: Alexander Semke Date: Wed, 13 Jan 2021 20:18:57 +0000 To: kde-devel Subject: Re: Accessing a (sub)menu defined in an XmlGui ui.rc file Message-Id: <2447074.Lt9SDvczpP () linux-2rd5> X-MARC-Message: https://marc.info/?l=kde-devel&m=161056916712595 Hi Tobias, > I have a problem with a KXmlGuiWindow and I honestly can't find respecti= ve > 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 that = I > can > e. g. disable or hide the menu, or assign an icon? For manually defined > menus, In your main window class deriving from KXMLGuiWindow you do the following= : 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? =2D- Alexander