Qt 4.8
|
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework. More...
#include <qgraphicssceneevent.h>
Public Functions | |
Qt::KeyboardModifiers | modifiers () const |
Returns the keyboard modifiers in use when the context menu was requested. More... | |
QPointF | pos () const |
Returns the position of the mouse cursor in item coordinates at the moment the context menu was requested. More... | |
QGraphicsSceneContextMenuEvent (Type type=None) | |
Constructs a graphics scene context menu event of the specified type. More... | |
Reason | reason () const |
Returns the reason for the context menu event. More... | |
QPointF | scenePos () const |
Returns the position of the mouse cursor in scene coordinates at the moment the the context menu was requested. More... | |
QPoint | screenPos () const |
Returns the position of the mouse cursor in screen coordinates at the moment the the context menu was requested. More... | |
void | setModifiers (Qt::KeyboardModifiers modifiers) |
Sets the keyboard modifiers associated with the context menu to the modifiers specified. More... | |
void | setPos (const QPointF &pos) |
Sets the position associated with the context menu to the given point in item coordinates. More... | |
void | setReason (Reason reason) |
Sets the reason for the context menu event to reason. More... | |
void | setScenePos (const QPointF &pos) |
Sets the position associated with the context menu to the given point in scene coordinates. More... | |
void | setScreenPos (const QPoint &pos) |
Sets the position associated with the context menu to the given point in screen coordinates. More... | |
~QGraphicsSceneContextMenuEvent () | |
Destroys the event. More... | |
Public Functions inherited from QGraphicsSceneEvent | |
QGraphicsSceneEvent (Type type) | |
Constructs a generic graphics scene event of the specified type. More... | |
void | setWidget (QWidget *widget) |
Sets the widget related to this event. More... | |
QWidget * | widget () const |
Returns the widget where the event originated, or 0 if the event originates from another application. More... | |
~QGraphicsSceneEvent () | |
Destroys the event. More... | |
Public Functions inherited from QEvent | |
void | accept () |
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). More... | |
void | ignore () |
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). More... | |
bool | isAccepted () const |
QEvent (Type type) | |
Contructs an event object of type type. More... | |
void | setAccepted (bool accepted) |
bool | spontaneous () const |
Returns true if the event originated outside the application (a system event); otherwise returns false. More... | |
Type | type () const |
Returns the event type. More... | |
virtual | ~QEvent () |
Destroys the event. More... | |
Additional Inherited Members | |
Static Public Functions inherited from QEvent | |
static int | registerEventType (int hint=-1) |
Registers and returns a custom event type. More... | |
Protected Functions inherited from QGraphicsSceneEvent | |
QGraphicsSceneEvent (QGraphicsSceneEventPrivate &dd, Type type=None) | |
Constructs a generic graphics scene event. More... | |
Protected Variables inherited from QGraphicsSceneEvent | |
QScopedPointer< QGraphicsSceneEventPrivate > | d_ptr |
Protected Variables inherited from QEvent | |
QEventPrivate * | d |
ushort | t |
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.
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()).
Definition at line 166 of file qgraphicssceneevent.h.
This enum describes the reason why the context event was sent.
Enumerator | |
---|---|
Mouse | |
Keyboard | |
Other |
Definition at line 169 of file qgraphicssceneevent.h.
Constructs a graphics scene context menu event of the specified type.
Definition at line 877 of file qgraphicssceneevent.cpp.
QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent | ( | ) |
Qt::KeyboardModifiers QGraphicsSceneContextMenuEvent::modifiers | ( | ) | const |
Returns the keyboard modifiers in use when the context menu was requested.
Definition at line 976 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), and setModifiers().
QPointF QGraphicsSceneContextMenuEvent::pos | ( | ) | const |
Returns the position of the mouse cursor in item coordinates at the moment the context menu was requested.
Definition at line 895 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QTextControl::processEvent(), QGraphicsItemPrivate::remapItemPos(), setPos(), setScenePos(), and setScreenPos().
QGraphicsSceneContextMenuEvent::Reason QGraphicsSceneContextMenuEvent::reason | ( | ) | const |
Returns the reason for the context menu event.
Definition at line 1002 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsProxyWidget::contextMenuEvent(), QDeclarativeMouseArea::contextMenuEvent(), and setReason().
QPointF QGraphicsSceneContextMenuEvent::scenePos | ( | ) | const |
Returns the position of the mouse cursor in scene coordinates at the moment the the context menu was requested.
Definition at line 923 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), and QGraphicsScene::contextMenuEvent().
QPoint QGraphicsSceneContextMenuEvent::screenPos | ( | ) | const |
Returns the position of the mouse cursor in screen coordinates at the moment the the context menu was requested.
Definition at line 951 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsProxyWidget::contextMenuEvent(), QGraphicsScene::contextMenuEvent(), and QTextControl::processEvent().
void QGraphicsSceneContextMenuEvent::setModifiers | ( | Qt::KeyboardModifiers | modifiers | ) |
Sets the keyboard modifiers associated with the context menu to the modifiers specified.
Definition at line 991 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), and QGraphicsView::contextMenuEvent().
void QGraphicsSceneContextMenuEvent::setPos | ( | const QPointF & | point | ) |
Sets the position associated with the context menu to the given point in item coordinates.
Definition at line 911 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsScene::contextMenuEvent(), and QGraphicsItemPrivate::remapItemPos().
void QGraphicsSceneContextMenuEvent::setReason | ( | Reason | reason | ) |
Sets the reason for the context menu event to reason.
Definition at line 1017 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), and QGraphicsView::contextMenuEvent().
void QGraphicsSceneContextMenuEvent::setScenePos | ( | const QPointF & | point | ) |
Sets the position associated with the context menu to the given point in scene coordinates.
Definition at line 939 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), and QGraphicsView::contextMenuEvent().
void QGraphicsSceneContextMenuEvent::setScreenPos | ( | const QPoint & | point | ) |
Sets the position associated with the context menu to the given point in screen coordinates.
Definition at line 967 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), and QGraphicsView::contextMenuEvent().