Interface for all plugins which provide entries to the main menubar. More...
#include <MenuInterface.hh>
Signals | |
| virtual void | getMenubarMenu (QString, QMenu *&, bool) |
| Get a existing toplevel menu pointer or create a new one. | |
| virtual void | addMenubarAction (QAction *, QString) |
| Adds an action to the menubar. | |
Public Member Functions | |
| virtual | ~MenuInterface () |
| Destructor. | |
Interface for all plugins which provide entries to the main menubar.
To add custom menus or actions to the menubar, you have to use this interface class. Create your own QMenu or QAction and emit addMenubarAction to add it to one of the menubar toplevel menus. You can also get a pointer to one existing toplevel menus or create a new one with the getMenubarMenu function. You can connect the signals and slots for your menu or action inside the plugin.
Definition at line 82 of file MenuInterface.hh.
| virtual void MenuInterface::addMenubarAction | ( | QAction * | , | |
| QString | ||||
| ) | [inline, virtual, signal] |
Adds an action to the menubar.
Add an action to one of the menubar toplevel menus
Example :
QMenu *colorMenu = new QMenu(tr("&Colors"));
emit addMenubarAction( colorMenu->menuAction(), TOOLSMENU )
All actions or sub actions can be freely controlled by yourself. You have to connect the required signals and slots to your plugin.
| _action | Pointer to the new action | |
| _name | Name of the menu |
Definition at line 115 of file MenuInterface.hh.
| virtual void MenuInterface::getMenubarMenu | ( | QString | , | |
| QMenu *& | , | |||
| bool | ||||
| ) | [inline, virtual, signal] |
Get a existing toplevel menu pointer or create a new one.
Checks if a toplevel menu is present and creates one if needed
| _name | Menu name (see FILEMENU/VIEWMENU/TOOLSMENU example defines) | |
| _menu | The returned toplevel menu | |
| _create | Should a new menu be created if id doesn't exist |
Definition at line 99 of file MenuInterface.hh.