QGraphicsSceneHoverEvent 類

QGraphicsSceneHoverEvent 類提供在圖形視圖框架中的懸停事件。 更多...

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

Returns the last recorded mouse cursor position in item coordinates.

另請參閱 lastScenePos (), lastScreenPos (),和 pos ().

QPointF QGraphicsSceneHoverEvent:: lastScenePos () const

Returns the last recorded, the scene coordinates of the previous mouse or hover event received by the view, that created the event mouse cursor position in scene coordinates.

另請參閱 lastPos (), lastScreenPos (),和 scenePos ().

QPoint QGraphicsSceneHoverEvent:: lastScreenPos () const

Returns the last recorded mouse cursor position in screen coordinates. The last recorded position is the position of the previous mouse or hover event received by the view that created the event.

另請參閱 lastPos (), lastScenePos (),和 screenPos ().

Qt::KeyboardModifiers QGraphicsSceneHoverEvent:: modifiers () const

Returns the keyboard modifiers at the moment the hover event was sent.

QPointF QGraphicsSceneHoverEvent:: pos () const

Returns the position of the mouse cursor in item coordinates at the moment the hover event was sent.

另請參閱 scenePos () 和 screenPos ().

QPointF QGraphicsSceneHoverEvent:: scenePos () const

Returns the position of the mouse cursor in scene coordinates at the moment the hover event was sent.

另請參閱 pos () 和 screenPos ().

QPoint QGraphicsSceneHoverEvent:: screenPos () const

Returns the position of the mouse cursor in screen coordinates at the moment the hover event was sent.

另請參閱 pos () 和 scenePos ().