MenuInterface Class Reference

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

#include <MenuInterface.hh>

List of all members.

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.

Detailed Description

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.


Member Function Documentation

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.

Parameters:
_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

Parameters:
_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.


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

acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .