QGraphicsSceneContextMenuEvent Class

QGraphicsSceneContextMenuEvent 클래스는 그래픽 뷰 프레임워크에서 컨텍스트 메뉴 이벤트를 제공합니다. 더 보기...

Header: #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

이 열거형은 컨텍스트 이벤트가 전송된 이유를 설명합니다.

Constant설명
QGraphicsSceneContextMenuEvent::Mouse0마우스로 인해 이벤트가 전송되었습니다. 대부분의 플랫폼에서 이는 마우스 오른쪽 버튼이 클릭되었음을 의미합니다.
QGraphicsSceneContextMenuEvent::Keyboard1키보드로 인해 이벤트가 전송되었습니다. Windows 및 macOS에서는 메뉴 버튼을 눌렀음을 의미합니다.
QGraphicsSceneContextMenuEvent::Other2마우스나 키보드가 아닌 다른 수단을 통해 이벤트가 전송되었습니다.

멤버 함수 문서

[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

컨텍스트 메뉴가 요청된 시점의 마우스 커서 위치를 장면 좌표로 반환합니다.

pos() 및 screenPos()도 참조하세요 .

QPoint QGraphicsSceneContextMenuEvent::screenPos() const

컨텍스트 메뉴가 요청된 시점의 마우스 커서 위치를 화면 좌표로 반환합니다.

pos() 및 scenePos()도 참조하세요 .

© 2025 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.