[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Changing a menu text
From: Richard Moore <rich () kde ! org>
Date: 2002-09-12 17:10:07
[Download RAW message or body]
On Thursday 12 September 2002 4:22 pm, Aaron J. Seigo wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thursday 12 September 2002 01:45, Andras Mantia wrote:
> > Hi,
> >
> > How can I chane the text of the menu in the KMainWindow->menuBar()?
> > changeItem() needs the menu id, but as the menu is built up using the X=
ML
> > GUI interface, I know olny the name (as it is specified in the XML file=
).
> > So, how can I find out the id of a main menu if I know only the name (t=
he
> > displayed text is not good as it may change, also the I don't want to
> > rely on the position of the menu).
>
> try something like:
>
> actionCollection()->action("nameOfAction")->setText("New Text");
>
> this will have the benefit of changing it not only in your menu, but
> everywhere it is used, and without having to know where. (e.g. you might
> move it to another menu later, but you won't have to change the above
> code!)
That works for menu items, but not for the menus themselves.
Rich.
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic