texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Problem in extracting popup menu from the QAction


From: Gubinelli Massimiliano
Subject: Re: [Texmacs-dev] Problem in extracting popup menu from the QAction
Date: Wed, 25 Nov 2009 10:39:24 +0100

Hi,

On 25 nov. 09, at 06:38, siva prasad wrote:

Hi all,
In TeXmacs, There are some actions which have popup menu. I want the menu associated with that action. I want to have the list of actions in that menu.
I did like this :

Let "action" has some popup menu asociated.

QMenu *menu = action -> menu();
QList<QAction *> list = menu -> actions();

But  " list.count() "  is always returning ZERO ( 0 )  for all actions (those have popup menu also).
I want list of actions present in that popup menu.
How can I do ?
please help me if you know . . .  .


most of the TeXmacs menus are "lazy", i.e. they are build only when needed. So if you look at the submenu actions you will obtain 0.
You need to dynamically cast the QMenu to QTMLazyMenu and use force() to build the list of actions before inspecting the menu.

Keep in mind that menu customization is done in scheme so I do not guarantee that if you programmatically change the menus in the C++ code this will work.

best
massimiliano



thank you in advance,

siva.
address@hidden
_______________________________________________
Texmacs-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/texmacs-dev


reply via email to

[Prev in Thread] Current Thread [Next in Thread]