|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# QGraphicsSceneContextMenuEvent Class Reference
[QtGui module]

     #include <QGraphicsSceneContextMenuEvent>

Inherits QGraphicsSceneEvent.

This class was introduced in Qt 4.2.

- List of all members, including inherited members

### Public Types

- enum Reason { Mouse, Keyboard, Other }

### Public Functions

- ~QGraphicsSceneContextMenuEvent ()
- Qt::KeyboardModifiers modifiers () const
- QPointF pos () const
- Reason reason () const
- QPointF scenePos () const
- QPoint screenPos () const
- void setReason ( Reason reason )

- 2 public functions inherited from QGraphicsSceneEvent
- 6 public functions inherited from QEvent

### Additional Inherited Members

- 1 property inherited from QEvent

## Detailed Description

See also QGraphicsSceneMouseEvent.

## Member Type Documentation

### enum QGraphicsSceneContextMenuEvent::Reason

This enum describes the reason why the context event was sent.

Constant | Value | Description
--- | --- | ---
`QGraphicsSceneContextMenuEvent::Mouse` | `0` | The mouse caused the event to be sent. Normally this means the right mouse button was clicked, but this is platform dependent.
`QGraphicsSceneContextMenuEvent::Keyboard` | `1` | The keyboard caused this event to be sent. On Windows, this means the menu button was pressed.
`QGraphicsSceneContextMenuEvent::Other` | `2` | The event was sent by some other means (i.e. not by the mouse or keyboard).

## Member Function Documentation

### QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent ()

Destroys the event.

### Qt::KeyboardModifiers QGraphicsSceneContextMenuEvent::modifiers () const

Returns the keyboard modifiers in use when the context menu was requested.

### QPointF QGraphicsSceneContextMenuEvent::pos () const

Returns the position of the mouse cursor in item coordinates at the moment the the context menu was requested.

See also scenePos() and screenPos().

### Reason QGraphicsSceneContextMenuEvent::reason () const

Returns the reason for the context menu event.

See also setReason().

### QPointF QGraphicsSceneContextMenuEvent::scenePos () const

Returns the position of the mouse cursor in scene coordinates at the moment the the context menu was requested.

See also pos() and screenPos().

### QPoint QGraphicsSceneContextMenuEvent::screenPos () const

Returns the position of the mouse cursor in screen coordinates at the moment the the context menu was requested.

See also pos() and scenePos().

### void QGraphicsSceneContextMenuEvent::setReason ( Reason reason )

Sets the reason for the context menu event to reason.

See also reason().