Developer Documentation
|
Interface for all plugins which provide entries to the main menubar. More...
#include <OpenFlipper/BasePlugin/MenuInterface.hh>
Signals | |
virtual void | getMenubarMenu (QString _name, QMenu *&_menu, bool _create) |
Get a existing top level menu pointer or create a new one. More... | |
Public Member Functions | |
virtual | ~MenuInterface () |
Destructor. | |
virtual void | addMenubarAction (QAction *_action, QString _name) |
Adds an action to the menubar. More... | |
virtual void | addMenubarActions (std::vector< QAction * > &_actions, QString _name) |
Add multiple actions to the menu bar. More... | |
Interface for all plugins which provide entries to the main menubar.
Detailed description
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 top level menus. You can also get a pointer to one existing top level menu 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 91 of file MenuInterface.hh.
|
inlinevirtual |
Adds an action to the menubar.
Add an action to one of the menubar top level menus
Example :
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 126 of file MenuInterface.hh.
|
inlinevirtual |
Add multiple actions to the menu bar.
Does the same as multiple calls to addMenubarAction except it doesn't insert a separator between the individual items.
_actions | Vector of pointers to the new actions. |
_name | Name of the menu. |
Definition at line 136 of file MenuInterface.hh.
|
inlinevirtualsignal |
Get a existing top level menu pointer or create a new one.
Checks if a top level menu is present and creates one if needed
_name | Menu name (see FILEMENU/VIEWMENU/TOOLSMENU example defines or use other QStrings ) |
_menu | The returned top level menu |
_create | Should a new menu be created if id doesn't exist |
Definition at line 108 of file MenuInterface.hh.