Qt 4.8
|
The QGraphicsSceneHelpEvent class provides events when a tooltip is requested. More...
#include <qgraphicssceneevent.h>
Public Functions | |
QGraphicsSceneHelpEvent (Type type=None) | |
Constructs a graphics scene help event of the specified type. More... | |
QPointF | scenePos () const |
Returns the position of the mouse cursor in scene coordinates at the moment the help event was sent. More... | |
QPoint | screenPos () const |
Returns the position of the mouse cursor in screen coordinates at the moment the help event was sent. More... | |
void | setScenePos (const QPointF &pos) |
Sets the position associated with the context menu to the given point in scene coordinates. More... | |
void | setScreenPos (const QPoint &pos) |
Sets the position associated with the context menu to the given point in screen coordinates. More... | |
~QGraphicsSceneHelpEvent () | |
Destroys the event. More... | |
Public Functions inherited from QGraphicsSceneEvent | |
QGraphicsSceneEvent (Type type) | |
Constructs a generic graphics scene event of the specified type. More... | |
void | setWidget (QWidget *widget) |
Sets the widget related to this event. More... | |
QWidget * | widget () const |
Returns the widget where the event originated, or 0 if the event originates from another application. More... | |
~QGraphicsSceneEvent () | |
Destroys the event. More... | |
Public Functions inherited from QEvent | |
void | accept () |
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). More... | |
void | ignore () |
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). More... | |
bool | isAccepted () const |
QEvent (Type type) | |
Contructs an event object of type type. More... | |
void | setAccepted (bool accepted) |
bool | spontaneous () const |
Returns true if the event originated outside the application (a system event); otherwise returns false. More... | |
Type | type () const |
Returns the event type. More... | |
virtual | ~QEvent () |
Destroys the event. More... | |
The QGraphicsSceneHelpEvent class provides events when a tooltip is requested.
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 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 QWhatsThisWhat'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.
Definition at line 228 of file qgraphicssceneevent.h.
Constructs a graphics scene help event of the specified type.
Definition at line 1262 of file qgraphicssceneevent.cpp.
QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent | ( | ) |
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 1280 of file qgraphicssceneevent.cpp.
Referenced by QGraphicsProxyWidget::event(), and QGraphicsScene::helpEvent().
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 1308 of file qgraphicssceneevent.cpp.
Referenced by QGraphicsProxyWidget::event(), and QGraphicsScene::helpEvent().
void QGraphicsSceneHelpEvent::setScenePos | ( | const QPointF & | point | ) |
Sets the position associated with the context menu to the given point in scene coordinates.
Definition at line 1296 of file qgraphicssceneevent.cpp.
Referenced by QGraphicsView::viewportEvent().
void QGraphicsSceneHelpEvent::setScreenPos | ( | const QPoint & | point | ) |
Sets the position associated with the context menu to the given point in screen coordinates.
Definition at line 1324 of file qgraphicssceneevent.cpp.
Referenced by QGraphicsView::viewportEvent().