QGraphicsSceneContextMenuEvent Class
QGraphicsSceneContextMenuEvent 클래스는 그래픽 뷰 프레임워크에서 컨텍스트 메뉴 이벤트를 제공합니다. 더 보기...
| 헤더: | #include <QGraphicsSceneContextMenuEvent> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
| qmake: | QT += widgets |
| 상속: | 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 |
상세 설명
QGraphicsView 가 수신한 ` QContextMenuEvent `는 `QGraphicsSceneContextMenuEvent`로 변환됩니다. ` QContextMenuEvent::globalPos()`는 항목, 장면 및 화면 좌표(`pos()`, ` scenePos()`, ` screenPos()`)로 변환됩니다.
QGraphicsSceneMouseEvent, QGraphicsSceneWheelEvent 및 QContextMenuEvent도 참조하십시오 .
멤버 유형 문서
enum QGraphicsSceneContextMenuEvent::Reason
이 열거형은 컨텍스트 이벤트가 전송된 이유를 설명합니다.
| 상수 | 값 | 설명 |
|---|---|---|
QGraphicsSceneContextMenuEvent::Mouse | 0 | 마우스로 인해 이벤트가 전송되었습니다. 대부분의 플랫폼에서 이는 마우스 오른쪽 버튼이 클릭되었음을 의미합니다. |
QGraphicsSceneContextMenuEvent::Keyboard | 1 | 키보드로 인해 이 이벤트가 전송되었습니다. Windows 및 macOS에서는 메뉴 버튼이 눌린 것을 의미합니다. |
QGraphicsSceneContextMenuEvent::Other | 2 | 이벤트가 다른 방법(즉, 마우스나 키보드가 아닌)으로 전송되었습니다. |
멤버 함수 문서
[virtual noexcept] QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent()
이벤트를 삭제합니다.
Qt::KeyboardModifiers QGraphicsSceneContextMenuEvent::modifiers() const
컨텍스트 메뉴가 호출되었을 때 사용 중이던 키보드 수정 키를 반환합니다.
QPointF QGraphicsSceneContextMenuEvent::pos() const
컨텍스트 메뉴가 호출된 시점의 마우스 커서 위치를 항목 좌표계 기준으로 반환합니다.
scenePos() 및 screenPos()도 참조하십시오 .
QGraphicsSceneContextMenuEvent::Reason QGraphicsSceneContextMenuEvent::reason() const
컨텍스트 메뉴 이벤트의 원인을 반환합니다.
QGraphicsSceneContextMenuEvent::Reason도 참조하십시오 .
QPointF QGraphicsSceneContextMenuEvent::scenePos() const
컨텍스트 메뉴가 요청된 시점의 마우스 커서 위치를 씬 좌표계로 반환합니다.
QPoint QGraphicsSceneContextMenuEvent::screenPos() const
컨텍스트 메뉴가 요청된 시점의 마우스 커서 위치를 화면 좌표로 반환합니다.
© 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.