Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MenuInterface Class Reference

Interface for all plugins which provide entries to the main menubar. More...

#include <OpenFlipper/BasePlugin/MenuInterface.hh>

Inheritance diagram for MenuInterface:
BackupPlugin ColorPlugin PrimitivesGeneratorPlugin PrintPlugin ScriptingPlugin TextureControlPlugin VsiPlugin

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...
 

Detailed Description

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.

Member Function Documentation

virtual void MenuInterface::addMenubarAction ( QAction *  _action,
QString  _name 
)
inlinevirtual

Adds an action to the menubar.

Add an action to one of the menubar top level 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.

Parameters
_actionPointer to the new action
_nameName of the menu

Definition at line 126 of file MenuInterface.hh.

virtual void MenuInterface::addMenubarActions ( std::vector< QAction * > &  _actions,
QString  _name 
)
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.

Parameters
_actionsVector of pointers to the new actions.
_nameName of the menu.

Definition at line 136 of file MenuInterface.hh.

virtual void MenuInterface::getMenubarMenu ( QString  _name,
QMenu *&  _menu,
bool  _create 
)
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

Parameters
_nameMenu name (see FILEMENU/VIEWMENU/TOOLSMENU example defines or use other QStrings )
_menuThe returned top level menu
_createShould a new menu be created if id doesn't exist

Definition at line 108 of file MenuInterface.hh.


The documentation for this class was generated from the following file: