[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:       Ismael Asensio <isma.af () gmail ! com>
Date:       2021-01-13 13:58:25
Message-ID: CANxjQMgEFPnkw_E7=j1n7d6c7abWop7LSoy85t+jjHvjPYUCfw () mail ! gmail ! com
[Download RAW message or body]

Once you have the main QAction, it has a menu() method, which in turn has
an actions() method.

So for instance:
 bar = foo->menu()->actions().at(0).

Of course with much more logic to check that every item exists and not
hardcoding the position, but I hope you get the point.

El mié., 13 ene. 2021 14:24, Thomas Baumgart <thb@net-bembel.de> escribió:

> On Mittwoch, 13. Januar 2021 11:50:50 CET Tobias Leupold wrote:
>
> > Hi Thomas!
> >
> > Thanks for this info, but this is about context menus ... I want to
> access a
> > submenu inside a menu of the main menu bar ... such as the "File" -->
> > "Recently used" menu of KWrite or such
>
> Ooops, my bad, or as we say in German "Thema verfehlt, setzen, sechs" :)
>
> --
>
> Regards
>
> Thomas Baumgart
>
> https://www.signal.org/       Signal, the better WhatsApp
> -------------------------------------------------------------
> The shortest words, namely yes and no,
> require the most thoughts. -- Pythagoras of Samos
> -------------------------------------------------------------
>

[Attachment #3 (text/html)]

<div dir="auto">Once you have the main QAction, it has a menu() method, which in turn \
has an actions() method.<div dir="auto"><br></div><div dir="auto">So for \
instance:</div><div dir="auto">  bar = foo-&gt;menu()-&gt;actions().at(0).</div><div \
dir="auto"><br></div><div dir="auto">Of course with much more logic to check that \
every item exists and not hardcoding the position, but I hope you get the \
point.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El \
mié., 13 ene. 2021 14:24, Thomas Baumgart &lt;<a \
href="mailto:thb@net-bembel.de">thb@net-bembel.de</a>&gt; \
escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">On Mittwoch, 13. Januar 2021 \
11:50:50 CET Tobias Leupold wrote:<br> <br>
&gt; Hi Thomas!<br>
&gt; <br>
&gt; Thanks for this info, but this is about context menus ... I want to access a<br>
&gt; submenu inside a menu of the main menu bar ... such as the &quot;File&quot; \
--&gt;<br> &gt; &quot;Recently used&quot; menu of KWrite or such<br>
<br>
Ooops, my bad, or as we say in German &quot;Thema verfehlt, setzen, sechs&quot; \
:)<br> <br>
-- <br>
<br>
Regards<br>
<br>
Thomas Baumgart<br>
<br>
<a href="https://www.signal.org/" rel="noreferrer noreferrer" \
                target="_blank">https://www.signal.org/</a>           Signal, the \
                better WhatsApp<br>
-------------------------------------------------------------<br>
The shortest words, namely yes and no,<br>
require the most thoughts. -- Pythagoras of Samos<br>
-------------------------------------------------------------<br>
</blockquote></div>



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

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