QGraphicsSceneHelpEvent Class

The QGraphicsSceneHelpEvent class provides events when a tooltip is requested. \since 4.2 \ingroup graphicsview-api \inmodule QtWidgets. More...

Header: #include <QGraphicsSceneHelpEvent>
Inherits: QGraphicsSceneEvent

Public Functions

QGraphicsSceneHelpEvent(Type type = None)
virtual ~QGraphicsSceneHelpEvent()
QPointF scenePos() const
QPoint screenPos() const
void setScenePos(const QPointF &point)
void setScreenPos(const QPoint &point)

Detailed Description

When a QGraphicsView receives a QEvent of type QEvent::ToolTip, it creates a QGraphicsSceneHelpEvent, which is forwarded to the scene. You can set a tooltip on a QGraphicsItem with setToolTip(); by default QGraphicsScene displays the tooltip of the QGraphicsItem with the highest z-value (i.e, the top-most item) under the mouse position.

QGraphicsView does not forward events when "What's This" and status tip help is requested. If you need this, you can reimplement QGraphicsView::viewportEvent() and forward QStatusTipEvent events and QEvents of type QEvent::WhatsThis to the scene.

See also QEvent.

Member Function Documentation

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

\internal

Constructs a graphics scene help event of the specified type.

[virtual noexcept] QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent()

Destroys the event.

QPointF QGraphicsSceneHelpEvent::scenePos() const

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

See also setScenePos() and screenPos().

QPoint QGraphicsSceneHelpEvent::screenPos() const

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

See also setScreenPos() and scenePos().

void QGraphicsSceneHelpEvent::setScenePos(const QPointF &point)

\internal

Sets the position associated with the context menu to the given point in scene coordinates.

See also scenePos().

void QGraphicsSceneHelpEvent::setScreenPos(const QPoint &point)

\internal

Sets the position associated with the context menu to the given point in screen coordinates.

See also screenPos().