ContextMenuAction Struct Reference

An action to be used on a context menu. More...

#include <ContextMenuAction.h>

List of all members.

Public Types

enum  BuddyTypeEnum { BEFORE, AFTER, REMOVE }
typedef EnumWrapper
< BuddyTypeEnum
BuddyType

Public Member Functions

 ContextMenuAction (QAction *pAction, const std::string &id)
ContextMenuActionoperator= (const ContextMenuAction &menuAction)
bool operator== (const ContextMenuAction &menuAction) const

Public Attributes

QAction * mpAction
std::string mId
BuddyType mBuddyType
std::string mBuddyId


Detailed Description

An action to be used on a context menu.

See also:
Customizing context menus

Definition at line 24 of file ContextMenuAction.h.


Member Typedef Documentation

The EnumWrapper contains a given enum value and provides a isValid() method which returns true if the contained enum value is valid.

Please see How To Use EnumWrapper for more information. The wrapped enum values are BuddyTypeEnum.

Definition at line 40 of file ContextMenuAction.h.


Member Enumeration Documentation

Defines how the associated buddy action is used when adding this action to the context menu.

Enumerator:
BEFORE  This action should appear above the buddy action.

AFTER  This action should appear below the buddy action.

REMOVE  The buddy action should be removed from the context menu.

Definition at line 30 of file ContextMenuAction.h.


Constructor & Destructor Documentation

ContextMenuAction::ContextMenuAction ( QAction *  pAction,
const std::string &  id 
)

Creates the context menu action.

Parameters:
pAction The Qt action to add to the context menu. If NULL is passed in, this action can only be used to remove an action from the menu.
id The unique identifier for this action. If an empty string is passed in, this action can only be used to remove an action from the menu.

Definition at line 54 of file ContextMenuAction.h.


Member Function Documentation

ContextMenuAction& ContextMenuAction::operator= ( const ContextMenuAction menuAction  ) 

Assigns the values in this action to those of another action.

Parameters:
menuAction The source action from which to assign this action's values.
Returns:
A reference to *this, which has been changed to have the same values as menuAction.

Definition at line 69 of file ContextMenuAction.h.

bool ContextMenuAction::operator== ( const ContextMenuAction menuAction  )  const

Compares two actions.

Parameters:
menuAction The action to compare against this action.
Returns:
Returns true if all values in this action are equal to those of menuAction.

Definition at line 91 of file ContextMenuAction.h.


Member Data Documentation

The Qt action that should appear on the context menu.

If this value is NULL, this ContextMenuAction can only be used to remove an action from the menu.

See also:
mBuddyId

Definition at line 110 of file ContextMenuAction.h.

The unique identifier for the Qt action that should appear on the context menu.

If this string is empty, this ContextMenuAction can only be used to remove an action from the menu.

See also:
mBuddyId

Definition at line 121 of file ContextMenuAction.h.

Defines how the buddy action is used.

See also:
BuddyType

Definition at line 128 of file ContextMenuAction.h.

The unique identifier for the associated buddy action.

The buddy action is used as a reference when placing this action on the menu. It can also be used as an action which should be removed from the menu.

See also:
mBuddyType

Definition at line 139 of file ContextMenuAction.h.


Software Development Kit - Opticks 4.9.0 Build 16218