![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework. More...
#include <qgraphicssceneevent.h>
Public Member Functions | |
QGraphicsSceneContextMenuEvent (Type type=None) | |
~QGraphicsSceneContextMenuEvent () | |
Destroys the event. | |
QPointF | pos () const |
Returns the position of the mouse cursor in item coordinates at the moment the context menu was requested. | |
void | setPos (const QPointF &pos) |
QPointF | scenePos () const |
Returns the position of the mouse cursor in scene coordinates at the moment the context menu was requested. | |
void | setScenePos (const QPointF &pos) |
QPoint | screenPos () const |
Returns the position of the mouse cursor in screen coordinates at the moment the context menu was requested. | |
void | setScreenPos (const QPoint &pos) |
Qt::KeyboardModifiers | modifiers () const |
Returns the keyboard modifiers in use when the context menu was requested. | |
void | setModifiers (Qt::KeyboardModifiers modifiers) |
Reason | reason () const |
Returns the reason for the context menu event. | |
void | setReason (Reason reason) |
![]() | |
QGraphicsSceneEvent (Type type) | |
~QGraphicsSceneEvent () | |
Destroys the event. | |
QWidget * | widget () const |
Returns the widget where the event originated, or \nullptr if the event originates from another application. | |
void | setWidget (QWidget *widget) |
quint64 | timestamp () const |
void | setTimestamp (quint64 ts) |
![]() | |
QEvent (Type type) | |
Constructs an event object of type type. | |
virtual | ~QEvent () |
Destroys the event. | |
Type | type () const |
Returns the event type. | |
bool | spontaneous () const |
Returns true if the event originated outside the application (a system event); otherwise returns false . | |
virtual void | setAccepted (bool accepted) |
bool | isAccepted () const |
void | accept () |
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). | |
void | ignore () |
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). | |
bool | isInputEvent () const noexcept |
bool | isPointerEvent () const noexcept |
bool | isSinglePointEvent () const noexcept |
virtual QEvent * | clone () const |
Creates and returns an identical copy of this event. | |
Additional Inherited Members | |
![]() | |
static int | registerEventType (int hint=-1) noexcept |
![]() | |
QGraphicsSceneEvent (QGraphicsSceneEventPrivate &dd, Type type=None) | |
![]() | |
QT_DEFINE_TAG_STRUCT (InputEventTag) | |
QEvent (Type type, InputEventTag) | |
QT_DEFINE_TAG_STRUCT (PointerEventTag) | |
QEvent (Type type, PointerEventTag) | |
QT_DEFINE_TAG_STRUCT (SinglePointEventTag) | |
QEvent (Type type, SinglePointEventTag) | |
![]() | |
QScopedPointer< QGraphicsSceneEventPrivate > | d_ptr |
![]() | |
quint16 | t |
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.
\inmodule QtWidgets
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 142 of file qgraphicssceneevent.h.
This enum describes the reason why the context event was sent.
\value Mouse The mouse caused the event to be sent. On most platforms, this means the right mouse button was clicked.
\value Keyboard The keyboard caused this event to be sent. On Windows and \macos, this means the menu button was pressed.
\value Other The event was sent by some other means (i.e. not by the mouse or keyboard).
Enumerator | |
---|---|
Mouse | |
Keyboard | |
Other |
Definition at line 145 of file qgraphicssceneevent.h.
Constructs a graphics scene context menu event of the specified type.
Definition at line 941 of file qgraphicssceneevent.cpp.
QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent | ( | ) |
Destroys the event.
Definition at line 949 of file qgraphicssceneevent.cpp.
Qt::KeyboardModifiers QGraphicsSceneContextMenuEvent::modifiers | ( | ) | const |
Returns the keyboard modifiers in use when the context menu was requested.
Definition at line 1031 of file qgraphicssceneevent.cpp.
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 959 of file qgraphicssceneevent.cpp.
QGraphicsSceneContextMenuEvent::Reason QGraphicsSceneContextMenuEvent::reason | ( | ) | const |
Returns the reason for the context menu event.
Definition at line 1054 of file qgraphicssceneevent.cpp.
QPointF QGraphicsSceneContextMenuEvent::scenePos | ( | ) | const |
Returns the position of the mouse cursor in scene coordinates at the moment the context menu was requested.
Definition at line 984 of file qgraphicssceneevent.cpp.
QPoint QGraphicsSceneContextMenuEvent::screenPos | ( | ) | const |
Returns the position of the mouse cursor in screen coordinates at the moment the context menu was requested.
Definition at line 1009 of file qgraphicssceneevent.cpp.
void QGraphicsSceneContextMenuEvent::setModifiers | ( | Qt::KeyboardModifiers | modifiers | ) |
Sets the keyboard modifiers associated with the context menu to the modifiers specified.
Definition at line 1043 of file qgraphicssceneevent.cpp.
Sets the position associated with the context menu to the given point in item coordinates.
Definition at line 972 of file qgraphicssceneevent.cpp.
Sets the reason for the context menu event to reason.
Definition at line 1066 of file qgraphicssceneevent.cpp.
Sets the position associated with the context menu to the given point in scene coordinates.
Definition at line 997 of file qgraphicssceneevent.cpp.
Sets the position associated with the context menu to the given point in screen coordinates.
Definition at line 1022 of file qgraphicssceneevent.cpp.