Developer Documentation

Signals | Public Member Functions | Private Slots | Private Member Functions | List of all members
ContextMenuInterface Class Reference

Interface class for creating custom context menus. More...

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

Inheritance diagram for ContextMenuInterface:

## Signals
virtual void | addContextMenuItem (QAction *_action, ContextMenuType _type)
| Add an entry for a context Menu. More...

## Public Member Functions
virtual | ~ContextMenuInterface ()
| Destructor.
virtual void | addContextMenuItem (QAction *_action, DataType _objectType, ContextMenuType _type)
| Add an entry for a context Menu. More...
virtual void | hideContextMenu ()
| hide the main context menu

## Private Slots
virtual void | slotUpdateContextMenu (int _objectId)

## Private Member Functions
virtual void | slotUpdateContextMenuNode (int _nodeId)
virtual void | slotUpdateContextMenuBackground ()

## Detailed Description

Interface class for creating custom context menus.

Detailed description
Using this interface you can create custom context menus for your plugin. You can choose between context menus for objects, nodes or the background.
Before a menu of the requested type is shown, an update function for the specific type will be invoked by the core. You have to create a QAction. The signals and slots of your actions have to be connected to your plugin. Just connect them as usual. Only visibility of the menu is handled by the core. You can also add submenus to the context menus. Just add the action for the menu ( menu->menuAction() )

Definition at line 85 of file ContextMenuInterface.hh.

## Member Function Documentation

## ◆ addContextMenuItem [1/2]

virtual void ContextMenuInterface::addContextMenuItem | ( | QAction * | _action,
|  | ContextMenuType | _type
| ) |  |
| inline virtual signal

Add an entry for a context Menu.

Create an Action (Can also be the action of a Menu) and register this menu as a context menu to the core. This Action will be visible when you right click in the viewer widget on an item of the given context menu type. You can add a whole menu here by adding the action: menu->menuAction() of your own menu.

Parameters

  _action | Pointer to the new Action
  _type | Type context menu type

Definition at line 104 of file ContextMenuInterface.hh.

## ◆ addContextMenuItem() [2/2]

virtual void ContextMenuInterface::addContextMenuItem | ( | QAction * | _action,
|  | DataType | _objectType,
|  | ContextMenuType | _type
| ) |  |
| inline virtual

Add an entry for a context Menu.

Create an action (Can also be the action of a Menu) and register this action as a context menu entry to the core. This Action will only be visible if the picked object is of the given DataType. To support multiple object types with your menu, you can emit this signal multiple times with the same action but different DataTypes. You can add a whole Menu here by adding the action: menu->menuAction()

Parameters

  _action | Pointer to the new action
  _objectType | Type of the picked object
  _type | Type of the context Menu ( See ContextMenuType )

Definition at line 118 of file ContextMenuInterface.hh.

## ◆ slotUpdateContextMenu

virtual void ContextMenuInterface::slotUpdateContextMenu | ( | int | _objectId | ) |
| inline private virtual slot

When the main application requests a context menu, this slot is called before showing the window. If an object is picked the id will be given in this call so you can change the contents of your menu depending on the given object.

Parameters

  _objectId | id of the object

Reimplemented in TypeBSplineCurvePlugin, TypeBSplineSurfacePlugin, TypeCameraPlugin, and TypeSkeletonPlugin.

Definition at line 131 of file ContextMenuInterface.hh.

## ◆ slotUpdateContextMenuBackground()

virtual void ContextMenuInterface::slotUpdateContextMenuBackground | ( |  | ) |
| inline private virtual

When the main application requests a context menu, this slot is called before showing the window. This slot will be called indicating that the background has been picked.

Definition at line 145 of file ContextMenuInterface.hh.

## ◆ slotUpdateContextMenuNode()

virtual void ContextMenuInterface::slotUpdateContextMenuNode | ( | int | _nodeId | ) |
| inline private virtual

When the main application requests a context menu, this slot is called before showing the window. This slot will be called indicating that a scenegraph node not belonging to an object has been picked.

Parameters

  _nodeId | id of the picked node

Definition at line 139 of file ContextMenuInterface.hh.

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

- OpenFlipper/BasePlugin/ContextMenuInterface.hh