Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Signals | Public Member Functions | List of all members
MenuInterface Class Reference

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

`#include <OpenFlipper/BasePlugin/MenuInterface.hh>`

Inheritance diagram for MenuInterface:

## 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
| ) |  |
| inline virtual

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

  _action | Pointer to the new action
  _name | Name of the menu

Definition at line 126 of file MenuInterface.hh.

virtual void MenuInterface::addMenubarActions | ( | std::vector< QAction * > & | _actions,
|  | QString | _name
| ) |  |
| inline virtual

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

  _actions | Vector of pointers to the new actions.
  _name | Name of the menu.

Definition at line 136 of file MenuInterface.hh.

virtual void MenuInterface::getMenubarMenu | ( | QString | _name,
|  | QMenu *& | _menu,
|  | bool | _create
| ) |  |
| inline virtual signal

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

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

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

- OpenFlipper/BasePlugin/MenuInterface.hh