QGraphicsSceneMouseEvent Class

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

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

상세 설명

QGraphicsViewQMouseEvent 을 받으면 이를 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::MouseEventFlagQMouseEvent::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::MouseEventSourceQMouseEvent::source()도 참조하십시오 .

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