이 페이지에서

QGraphicsSceneMouseEvent Class

QGraphicsSceneMouseEvent 클래스는 그래픽 뷰 프레임워크에서 마우스 이벤트를 제공합니다. 더 보기...

헤더: #include <QGraphicsSceneMouseEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
상속: QGraphicsSceneEvent

공개 함수

virtual ~QGraphicsSceneMouseEvent()
Qt::MouseButton button() const
QPointF buttonDownPos(Qt::MouseButton button) const
QPointF buttonDownScenePos(Qt::MouseButton button) const
QPoint buttonDownScreenPos(Qt::MouseButton button) const
Qt::MouseButtons buttons() const
Qt::MouseEventFlags flags() const
QPointF lastPos() const
QPointF lastScenePos() const
QPoint lastScreenPos() const
Qt::KeyboardModifiers modifiers() const
QPointF pos() const
QPointF scenePos() const
QPoint screenPos() const
Qt::MouseEventSource source() const

상세 설명

QGraphicsView 가 QMouseEvent 를 수신하면, 이를 QGraphicsSceneMouseEvent로 변환합니다. 그런 다음 이 이벤트는 뷰와 연관된 QGraphicsScene 로 전달됩니다. 이벤트가 씬에서 처리되지 않는 경우, 뷰는 해당 이벤트를 사용할 수 있습니다(예: DragMode).

마우스 이벤트에는 이벤트의 항목, 장면 및 화면 좌표( pos(), scenePos(), screenPos()로 표시됨) 외에도, 뷰가 수신한 이전 마우스 이벤트의 좌표도 포함됩니다. 이러한 좌표는 lastPos(), lastScreenPos(), lastScenePos()를 통해 가져올 수 있습니다.

QGraphicsSceneContextMenuEvent, QGraphicsSceneHoverEvent, QGraphicsSceneWheelEvent 및 QMouseEvent도 참조하십시오 .

멤버 함수 문서

[virtual noexcept] QGraphicsSceneMouseEvent::~QGraphicsSceneMouseEvent()

이벤트를 삭제합니다.

Qt::MouseButton QGraphicsSceneMouseEvent::button() const

이벤트를 발생시킨 마우스 버튼(있는 경우)을 반환합니다.

buttons() 및 modifiers()도 참조하십시오 .

QPointF QGraphicsSceneMouseEvent::buttonDownPos(Qt::MouseButton button) const

지정된 ` button `가 클릭된 위치의 마우스 커서 위치를 항목 좌표계로 반환합니다.

buttonDownScenePos(), buttonDownScreenPos(), pos()도 참조하십시오 .

QPointF QGraphicsSceneMouseEvent::buttonDownScenePos(Qt::MouseButton button) const

지정된 ` button `가 클릭된 지점의 마우스 커서 위치를 씬 좌표계로 반환합니다.

buttonDownPos(), buttonDownScreenPos() 및 scenePos()도 참조하십시오 .

QPoint QGraphicsSceneMouseEvent::buttonDownScreenPos(Qt::MouseButton button) const

지정된 ‘ button ’이 클릭된 위치의 화면 좌표계 상의 마우스 커서 위치를 반환합니다.

screenPos(), buttonDownPos(), buttonDownScenePos()도 참조하십시오 .

Qt::MouseButtons QGraphicsSceneMouseEvent::buttons() const

이벤트가 전송된 시점에 눌려 있던 마우스 버튼의 조합을 반환합니다.

button() 및 modifiers()도 참조하십시오 .

Qt::MouseEventFlags QGraphicsSceneMouseEvent::flags() const

마우스 이벤트 플래그를 반환합니다.

마우스 이벤트 플래그는 마우스 이벤트에 대한 추가 정보를 제공합니다.

Qt::MouseEventFlag 및 QMouseEvent::flags()도 참조하십시오 .

QPointF QGraphicsSceneMouseEvent::lastPos() const

항목 좌표계에서 마지막으로 기록된 마우스 커서 위치를 반환합니다.

lastScenePos(), lastScreenPos(), pos()도 참조하십시오 .

QPointF QGraphicsSceneMouseEvent::lastScenePos() const

씬 좌표계에서 마지막으로 기록된 마우스 커서 위치를 반환합니다. 마지막으로 기록된 위치는 해당 이벤트를 생성한 뷰가 수신한 이전 마우스 이벤트의 위치입니다.

lastPos(), lastScreenPos(), scenePos()도 참조하십시오 .

QPoint QGraphicsSceneMouseEvent::lastScreenPos() const

화면 좌표계에서 마지막으로 기록된 마우스 커서 위치를 반환합니다. 마지막으로 기록된 위치는 해당 이벤트를 생성한 뷰가 수신한 이전 마우스 이벤트의 위치입니다.

lastPos(), lastScenePos(), screenPos()도 참조하십시오 .

Qt::KeyboardModifiers QGraphicsSceneMouseEvent::modifiers() const

이벤트가 전송된 시점에 사용 중이던 키보드 수정 키를 반환합니다.

buttons() 및 button()도 참조하십시오 .

QPointF QGraphicsSceneMouseEvent::pos() const

마우스 커서 위치를 항목 좌표계로 반환합니다.

scenePos(), screenPos(), lastPos()도 참조하십시오 .

QPointF QGraphicsSceneMouseEvent::scenePos() const

마우스 커서의 위치를 씬 좌표계로 반환합니다.

pos(), screenPos(), lastScenePos()도 참조하십시오 .

QPoint QGraphicsSceneMouseEvent::screenPos() const

마우스 커서의 위치를 화면 좌표로 반환합니다.

pos(), scenePos() 및 lastScreenPos()도 참조하십시오 .

Qt::MouseEventSource QGraphicsSceneMouseEvent::source() const

마우스 이벤트 소스에 대한 정보를 반환합니다.

마우스 이벤트 소스는 실제 마우스 이벤트와 인공 마우스 이벤트를 구별하는 데 사용할 수 있습니다. 인공 마우스 이벤트란 운영 체제나 Qt 자체에서 터치 이벤트를 기반으로 합성된 이벤트를 말합니다.

Qt::MouseEventSource 및 QMouseEvent::source()도 참조하십시오 .

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