QGraphicsSceneHoverEvent Class

QGraphicsSceneHoverEvent 类提供图形视图框架中的悬停事件。更多

Header: #include <QGraphicsSceneHoverEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
继承: QGraphicsSceneEvent

公共函数

virtual ~QGraphicsSceneHoverEvent()
QPointF lastPos() const
QPointF lastScenePos() const
QPoint lastScreenPos() const
Qt::KeyboardModifiers modifiers() const
QPointF pos() const
QPointF scenePos() const
QPoint screenPos() const

详细说明

QGraphicsView 接收到QHoverEvent 事件时,它会将其转换为 QGraphicsSceneHoverEvent。然后,该事件会被转发到与视图相关联的QGraphicsScene

另请参阅 QGraphicsSceneMouseEvent,QGraphicsSceneContextMenuEvent,QGraphicsSceneWheelEvent, 和QHoverEvent

成员函数文档

[virtual noexcept] QGraphicsSceneHoverEvent::~QGraphicsSceneHoverEvent()

摧毁事件。

QPointF QGraphicsSceneHoverEvent::lastPos() const

以项目坐标形式返回最后记录的鼠标指针位置。

另请参阅 lastScenePos()、lastScreenPos() 和pos()。

QPointF QGraphicsSceneHoverEvent::lastScenePos() const

返回最后记录的、视图接收到的上一个鼠标或悬停事件的场景坐标,该事件创建了以场景坐标表示的鼠标指针位置。

另请参阅 lastPos()、lastScreenPos() 和scenePos()。

QPoint QGraphicsSceneHoverEvent::lastScreenPos() const

以屏幕坐标形式返回上次记录的鼠标指针位置。最后记录的位置是创建事件的视图接收到的上一个鼠标或悬停事件的位置。

另请参阅 lastPos()、lastScenePos() 和screenPos()。

Qt::KeyboardModifiers QGraphicsSceneHoverEvent::modifiers() const

返回悬停事件发生时的键盘修饰符。

QPointF QGraphicsSceneHoverEvent::pos() const

返回悬停事件发生时鼠标指针在项目坐标中的位置。

另请参阅 scenePos() 和screenPos()。

QPointF QGraphicsSceneHoverEvent::scenePos() const

返回悬停事件发生时鼠标指针在场景坐标中的位置。

另请参阅 pos() 和screenPos()。

QPoint QGraphicsSceneHoverEvent::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.