QtBase
v6.3.1
|
The QGraphicsSceneHelpEvent class provides events when a tooltip is requested. More...
#include <qgraphicssceneevent.h>
Public Member Functions | |
QGraphicsSceneHelpEvent (Type type=None) | |
~QGraphicsSceneHelpEvent () | |
QPointF | scenePos () const |
void | setScenePos (const QPointF &pos) |
QPoint | screenPos () const |
void | setScreenPos (const QPoint &pos) |
Public Member Functions inherited from QGraphicsSceneEvent | |
QGraphicsSceneEvent (Type type) | |
~QGraphicsSceneEvent () | |
QWidget * | widget () const |
void | setWidget (QWidget *widget) |
quint64 | timestamp () const |
void | setTimestamp (quint64 ts) |
Public Member Functions inherited from QEvent | |
QEvent (Type type) | |
virtual | ~QEvent () |
Type | type () const |
bool | spontaneous () const |
virtual void | setAccepted (bool accepted) |
bool | isAccepted () const |
void | accept () |
void | ignore () |
bool | isInputEvent () const noexcept |
bool | isPointerEvent () const noexcept |
bool | isSinglePointEvent () const noexcept |
virtual QEvent * | clone () const |
The QGraphicsSceneHelpEvent class provides events when a tooltip is requested.
\inmodule QtWidgets
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 \l{QGraphicsItem::}{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 \l{QWhatsThis}{"What's This"} and \l{QStatusTipEvent}{status tip} help is requested. If you need this, you can reimplement QGraphicsView::viewportEvent() and forward QStatusTipEvent events and \l{QEvent}{QEvents} of type QEvent::WhatsThis to the scene.
Definition at line 240 of file qgraphicssceneevent.h.
Definition at line 1317 of file qgraphicssceneevent.cpp.
QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent | ( | ) |
Destroys the event.
Definition at line 1325 of file qgraphicssceneevent.cpp.
QPointF QGraphicsSceneHelpEvent::scenePos | ( | ) | const |
Returns the position of the mouse cursor in scene coordinates at the moment the help event was sent.
Definition at line 1335 of file qgraphicssceneevent.cpp.
QPoint QGraphicsSceneHelpEvent::screenPos | ( | ) | const |
Returns the position of the mouse cursor in screen coordinates at the moment the help event was sent.
Definition at line 1360 of file qgraphicssceneevent.cpp.
Definition at line 1348 of file qgraphicssceneevent.cpp.
Definition at line 1373 of file qgraphicssceneevent.cpp.