Auf dieser Seite

QGraphicsSceneContextMenuEvent Class

Die Klasse „QGraphicsSceneContextMenuEvent“ stellt Kontextmenü-Ereignisse im Grafikansichts-Framework bereit. Mehr...

Header: #include <QGraphicsSceneContextMenuEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
Erbt von: QGraphicsSceneEvent

Öffentliche Typen

enum Reason { Mouse, Keyboard, Other }

Öffentliche Funktionen

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

Ausführliche Beschreibung

Ein von einem „ QGraphicsView “ empfangenes „ QContextMenuEvent “ wird in ein „QGraphicsSceneContextMenuEvent“ umgewandelt. Die „ QContextMenuEvent::globalPos()“-Funktion wird in Element-, Szenen- und Bildschirmkoordinaten umgewandelt („pos()“, „ scenePos()“ und „ screenPos()“).

Siehe auch „ QGraphicsSceneMouseEvent “, „ QGraphicsSceneWheelEvent “ und „ QContextMenuEvent “.

Dokumentation zu Mitgliedstypen

enum QGraphicsSceneContextMenuEvent::Reason

Diese Enumeration beschreibt den Grund, aus dem das Kontext-Ereignis gesendet wurde.

KonstanteWertBeschreibung
QGraphicsSceneContextMenuEvent::Mouse0Die Maus hat das Senden des Ereignisses ausgelöst. Auf den meisten Plattformen bedeutet dies, dass die rechte Maustaste gedrückt wurde.
QGraphicsSceneContextMenuEvent::Keyboard1Die Tastatur hat das Senden dieses Ereignisses ausgelöst. Unter Windows und macOS bedeutet dies, dass die Menütaste gedrückt wurde.
QGraphicsSceneContextMenuEvent::Other2Das Ereignis wurde auf andere Weise ausgelöst (d. h. nicht durch die Maus oder die Tastatur).

Dokumentation der Member-Funktionen

[virtual noexcept] QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent()

Löscht das Ereignis.

Qt::KeyboardModifiers QGraphicsSceneContextMenuEvent::modifiers() const

Gibt die zum Zeitpunkt der Aufrufung des Kontextmenüs verwendeten Tastaturmodifikatoren zurück.

QPointF QGraphicsSceneContextMenuEvent::pos() const

Gibt die Position des Mauszeigers in Elementkoordinaten zum Zeitpunkt der Anforderung des Kontextmenüs zurück.

Siehe auch scenePos() und screenPos().

QGraphicsSceneContextMenuEvent::Reason QGraphicsSceneContextMenuEvent::reason() const

Gibt den Grund für das Kontextmenü-Ereignis zurück.

Siehe auch QGraphicsSceneContextMenuEvent::Reason.

QPointF QGraphicsSceneContextMenuEvent::scenePos() const

Gibt die Position des Mauszeigers in Szenenkoordinaten zum Zeitpunkt der Anforderung des Kontextmenüs zurück.

Siehe auch „ pos “ () und „ screenPos “ ().

QPoint QGraphicsSceneContextMenuEvent::screenPos() const

Gibt die Position des Mauszeigers in Bildschirmkoordinaten zum Zeitpunkt der Aufrufung des Kontextmenüs zurück.

Siehe auch „ pos()“ und „ scenePos()“.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.