[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:       Alexander Semke <alexander.semke () web ! de>
Date:       2021-01-13 20:18:57
Message-ID: 2447074.Lt9SDvczpP () linux-2rd5
[Download RAW message or body]

Hi Tobias,

> 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 ...
> [...]
> 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 = this->guiFactory();
auto* menu = dynamic_cast<QMenu*>(factory->container("bar", this));
if (menu) {
    //add your logic here with the menu pointer
}

Is this what you're looking for?

--
Alexander


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

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