Developer Documentation
|
Interface class for creating custom context menus. More...
#include <OpenFlipper/BasePlugin/ContextMenuInterface.hh>
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 () |
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 101 of file ContextMenuInterface.hh.
|
inlinevirtualsignal |
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.
_action | Pointer to the new Action |
_type | Type context menu type |
Definition at line 120 of file ContextMenuInterface.hh.
|
inlinevirtual |
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()
_action | Pointer to the new action |
_objectType | Type of the picked object |
_type | Type of the context Menu ( See ContextMenuType ) |
Definition at line 134 of file ContextMenuInterface.hh.
|
inlineprivatevirtualslot |
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.
_objectId | id of the object |
Reimplemented in TypeBSplineCurvePlugin, TypeBSplineSurfacePlugin, and TypeSkeletonPlugin.
Definition at line 147 of file ContextMenuInterface.hh.
|
inlineprivatevirtual |
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 161 of file ContextMenuInterface.hh.
|
inlineprivatevirtual |
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.
_nodeId | id of the picked node |
Definition at line 155 of file ContextMenuInterface.hh.