CopperSpice API  1.7.2
QGraphicsSceneContextMenuEvent Class Reference

The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view system. More...

Inheritance diagram for QGraphicsSceneContextMenuEvent:
QGraphicsSceneEvent QEvent

Public Types

enum  Reason
 
- Public Types inherited from QEvent
enum  Type
 

Public Methods

 ~QGraphicsSceneContextMenuEvent ()
 
Qt::KeyboardModifiers modifiers () const
 
QPointF pos () const
 
Reason reason () const
 
QPointF scenePos () const
 
QPoint screenPos () const
 
- Public Methods inherited from QGraphicsSceneEvent
 ~QGraphicsSceneEvent ()
 
QWidgetwidget () const
 
- Public Methods inherited from QEvent
 QEvent (const QEvent &other)
 
 QEvent (Type type)
 
virtual ~QEvent ()
 
void accept ()
 
void ignore ()
 
bool isAccepted () const
 
QEvent & operator= (const QEvent &other)
 
void setAccepted (bool accepted)
 
bool spontaneous () const
 
Type type () const
 

Additional Inherited Members

- Static Public Methods inherited from QEvent
static int registerEventType (int hint=-1)
 

Detailed Description

The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view system. A QContextMenuEvent received by a QGraphicsView is translated into a QGraphicsSceneContextMenuEvent. The QContextMenuEvent::globalPos() is translated into item, scene, and screen coordinates (pos(), scenePos(), and screenPos()).

See also
QGraphicsSceneMouseEvent, QGraphicsSceneWheelEvent, QContextMenuEvent

Member Enumeration Documentation

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

ConstantValueDescription
QGraphicsSceneContextMenuEvent::Mouse0The mouse caused the event to be sent. On most platforms, this means the right mouse button was clicked.
QGraphicsSceneContextMenuEvent::Keyboard1The keyboard caused this event to be sent. On Windows and Mac OS X, this means the menu button was pressed.
QGraphicsSceneContextMenuEvent::Other2The event was sent by some other means (i.e. not by the mouse or keyboard).

Constructor & Destructor Documentation

QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent ( )

Destroys the event.

Method Documentation

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 context menu was requested.

See also
scenePos(), screenPos()
Reason QGraphicsSceneContextMenuEvent::reason ( ) const

Returns the reason for the context menu event.

See also
QGraphicsSceneContextMenuEvent::Reason
QPointF QGraphicsSceneContextMenuEvent::scenePos ( ) const

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

See also
pos(), screenPos()
QPoint QGraphicsSceneContextMenuEvent::screenPos ( ) const

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

See also
pos(), scenePos()