The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework. More...
Header: | #include <QGraphicsSceneContextMenuEvent> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
qmake: | QT += widgets |
Inherits: | QGraphicsSceneEvent |
enum | Reason { Mouse, Keyboard, Other } |
virtual | ~QGraphicsSceneContextMenuEvent() |
Qt::KeyboardModifiers | modifiers() const |
QPointF | pos() const |
QGraphicsSceneContextMenuEvent::Reason | reason() const |
QPointF | scenePos() const |
QPoint | screenPos() const |
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, and QContextMenuEvent.
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. On most platforms, this means the right mouse button was clicked. |
QGraphicsSceneContextMenuEvent::Keyboard |
1 |
The keyboard caused this event to be sent. On Windows and macOS, 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). |
[virtual]
QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent()Destroys the event.
Returns the keyboard modifiers in use when the context menu was requested.
Returns the position of the mouse cursor in item coordinates at the moment the context menu was requested.
See also scenePos() and screenPos().
Returns the reason for the context menu event.
See also QGraphicsSceneContextMenuEvent::Reason.
Returns the position of the mouse cursor in scene coordinates at the moment the context menu was requested.
See also pos() and screenPos().
Returns the position of the mouse cursor in screen coordinates at the moment the context menu was requested.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: