Le 05/08/2016 à 12:54, racoon a écrit :

Sorry, missed your post. I have just a single icon there. So every
(non-submenu) item show an icon now. Replacing

qMenu.addAction(new Action(QIcon(), label(*m),

by, for example,

qMenu.addAction(new Action(QIcon("images/box-insert.svgz"), label(*m),

However, this leads to very slow performance (on my dual core at least).
Could it be that this is because LyX creates the menus on the fly?


Bad luck! It must indeed have to do with the fact that menus are emptied and re-created every time. To move forward one would need to know precisely what takes so much time though, whether it's creating the action, adding it to the qmenu, or something else. Profiling your code would help understand what goes wrong (e.g. with callgrind which is fun to use, see https://wiki.lyx.org/FAQ/FurtherHelp#profile). But I fear that in any case this would lead to a solution that involves a quite bigger rewrite of the code. So you have to see whether it's worth the time it is going to take.

Guillaume


Reply via email to