I would to get (for example) the menu "mymenu" or menu[0] and separators and actions...
How can I navigate trought them?
The final goal is to deal with menus.
Thanks
I would to get (for example) the menu "mymenu" or menu[0] and separators and actions...
How can I navigate trought them?
The final goal is to deal with menus.
Thanks
I think your question could not be less descriptive. Seriously, try to read it and imagine that you don't know anything about your problem.
From what I could deduce, you want to create some kind of a container with menus in order to access them by index or name ?
If yes, then create a QList of menus ( for index based access ) or a QMap<QString,QMenu*> ( for name based access ), then you could get something like:
QMenu * m = menu_map["main menu"];
But I don't see a reason for doing this. Can you provide more detailed description of your problem ? Maybe there is a better solution.
Thanks, and sorry for my bad comunication ....
Yes, I want to work with menus using its name or index.
Is there any method to get the whole menu of my app?
I want to work with the menu made in design....
Thanks again
Don't know if this will help you, but for every menu, you can get a list of it's actions by calling:
Qt Code:
QList<QAction*> actions = menu->actions();To copy to clipboard, switch view to plain text mode
QMainWindow menus created in designer are held in QMenuBar, maybe you can get list of all menus inserted in menu bar by "findChildren" method:
Qt Code:
QList<QMenu*> menus = mainWindow->menuBar()->findChildren<QMenu*>();To copy to clipboard, switch view to plain text mode
Be sure to read documentation for above methods before using them.
Still, I don't know what do you want to do with such lists.
Thanks stampede
Bookmarks