Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
The QGraphicsSceneHelpEvent class provides events when a tooltip is requested. More...
#include <qgraphicssceneevent.h>
Public Member Functions | |
QGraphicsSceneHelpEvent (Type type=None) | |
~QGraphicsSceneHelpEvent () | |
Destroys the event. | |
QPointF | scenePos () const |
Returns the position of the mouse cursor in scene coordinates at the moment the help event was sent. | |
void | setScenePos (const QPointF &pos) |
QPoint | screenPos () const |
Returns the position of the mouse cursor in screen coordinates at the moment the help event was sent. | |
void | setScreenPos (const QPoint &pos) |
Public Member Functions inherited from QGraphicsSceneEvent | |
QGraphicsSceneEvent (Type type) | |
~QGraphicsSceneEvent () | |
Destroys the event. | |
QWidget * | widget () const |
Returns the widget where the event originated, or \nullptr if the event originates from another application. | |
void | setWidget (QWidget *widget) |
quint64 | timestamp () const |
void | setTimestamp (quint64 ts) |
Public Member Functions inherited from QEvent | |
QEvent (Type type) | |
Constructs an event object of type type. | |
virtual | ~QEvent () |
Destroys the event. | |
Type | type () const |
Returns the event type. | |
bool | spontaneous () const |
Returns true if the event originated outside the application (a system event); otherwise returns false . | |
virtual void | setAccepted (bool accepted) |
bool | isAccepted () const |
void | accept () |
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). | |
void | ignore () |
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). | |
bool | isInputEvent () const noexcept |
bool | isPointerEvent () const noexcept |
bool | isSinglePointEvent () const noexcept |
virtual QEvent * | clone () const |
Creates and returns an identical copy of this event. | |
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 204 of file qgraphicssceneevent.h.
Constructs a graphics scene help event of the specified type.
Definition at line 1281 of file qgraphicssceneevent.cpp.
QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent | ( | ) |
Destroys the event.
Definition at line 1289 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 1299 of file qgraphicssceneevent.cpp.
References d.
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 1324 of file qgraphicssceneevent.cpp.
References d.
Sets the position associated with the context menu to the given point in scene coordinates.
Definition at line 1312 of file qgraphicssceneevent.cpp.
Referenced by QGraphicsView::viewportEvent().
Sets the position associated with the context menu to the given point in screen coordinates.
Definition at line 1337 of file qgraphicssceneevent.cpp.
Referenced by QGraphicsView::viewportEvent().