QGraphicsSceneHoverEvent Class

The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework. \since 4.2 \ingroup graphicsview-api \inmodule QtWidgets. More...

Header: #include <QGraphicsSceneHoverEvent>
Inherits: QGraphicsSceneEvent

Public Functions

QGraphicsSceneHoverEvent(Type type = None)
virtual ~QGraphicsSceneHoverEvent()
QPointF lastPos() const
QPointF lastScenePos() const
QPoint lastScreenPos() const
Qt::KeyboardModifiers modifiers() const
QPointF pos() const
QPointF scenePos() const
QPoint screenPos() const
void setLastPos(const QPointF &pos)
void setLastScenePos(const QPointF &pos)
void setLastScreenPos(const QPoint &pos)
void setModifiers(Qt::KeyboardModifiers modifiers)
void setPos(const QPointF &point)
void setScenePos(const QPointF &point)
void setScreenPos(const QPoint &point)

Detailed Description

When a QGraphicsView receives a QHoverEvent event, it translates it into QGraphicsSceneHoverEvent. The event is then forwarded to the QGraphicsScene associated with the view.

See also QGraphicsSceneMouseEvent, QGraphicsSceneContextMenuEvent, QGraphicsSceneWheelEvent, and QHoverEvent.

Member Function Documentation

[explicit] QGraphicsSceneHoverEvent::QGraphicsSceneHoverEvent(Type type = None)

\internal

Constructs a graphics scene hover event of the specified type.

[virtual noexcept] QGraphicsSceneHoverEvent::~QGraphicsSceneHoverEvent()

Destroys the event.

QPointF QGraphicsSceneHoverEvent::lastPos() const

\since4.4

Returns the last recorded mouse cursor position in item coordinates.

See also setLastPos(), lastScenePos(), lastScreenPos(), and pos().

QPointF QGraphicsSceneHoverEvent::lastScenePos() const

\since4.4

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.

See also setLastScenePos(), lastPos(), lastScreenPos(), and scenePos().

QPoint QGraphicsSceneHoverEvent::lastScreenPos() const

\since4.4

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.

See also setLastScreenPos(), lastPos(), lastScenePos(), and screenPos().

Qt::KeyboardModifiers QGraphicsSceneHoverEvent::modifiers() const

\since4.4

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

See also setModifiers().

QPointF QGraphicsSceneHoverEvent::pos() const

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

See also setPos(), scenePos(), and screenPos().

QPointF QGraphicsSceneHoverEvent::scenePos() const

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

See also setScenePos(), pos(), and screenPos().

QPoint QGraphicsSceneHoverEvent::screenPos() const

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

See also setScreenPos(), pos(), and scenePos().

void QGraphicsSceneHoverEvent::setLastPos(const QPointF &pos)

\internal

See also lastPos().

void QGraphicsSceneHoverEvent::setLastScenePos(const QPointF &pos)

\internal

See also lastScenePos().

void QGraphicsSceneHoverEvent::setLastScreenPos(const QPoint &pos)

\internal

See also lastScreenPos().

void QGraphicsSceneHoverEvent::setModifiers(Qt::KeyboardModifiers modifiers)

\internal

Sets the modifiers for the current hover event to modifiers.

See also modifiers().

void QGraphicsSceneHoverEvent::setPos(const QPointF &point)

\internal

Sets the position associated with the hover event to the given point in item coordinates.

See also pos().

void QGraphicsSceneHoverEvent::setScenePos(const QPointF &point)

\internal

Sets the position associated with the hover event to the given point in scene coordinates.

See also scenePos().

void QGraphicsSceneHoverEvent::setScreenPos(const QPoint &point)

\internal

Sets the position associated with the hover event to the given point in screen coordinates.

See also screenPos().