QtBase
v6.3.1
|
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework. More...
#include <qgraphicssceneevent.h>
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
\inmodule QtWidgets
When a QGraphicsView receives a QMouseEvent, it translates it to a QGraphicsSceneMouseEvent. The event is then forwarded to the QGraphicsScene associated with the view. If the event is not handled by the scene, the view may use it, e.g., for the \l{QGraphicsView::}{DragMode}.
In addition to containing the item, scene, and screen coordinates of the event (as pos(), scenePos(), and screenPos()), mouse events also contain the coordinates of the previous mouse event received by the view. These can be retrieved with lastPos(), lastScreenPos(), and lastScenePos().
Definition at line 82 of file qgraphicssceneevent.h.
Definition at line 392 of file qgraphicssceneevent.cpp.
QGraphicsSceneMouseEvent::~QGraphicsSceneMouseEvent | ( | ) |
Destroys the event.
Definition at line 400 of file qgraphicssceneevent.cpp.
Qt::MouseButton QGraphicsSceneMouseEvent::button | ( | ) | const |
Returns the mouse button (if any) that caused the event.
Definition at line 620 of file qgraphicssceneevent.cpp.
QPointF QGraphicsSceneMouseEvent::buttonDownPos | ( | Qt::MouseButton | button | ) | const |
Returns the mouse cursor position in item coordinates where the specified button was clicked.
Definition at line 470 of file qgraphicssceneevent.cpp.
QPointF QGraphicsSceneMouseEvent::buttonDownScenePos | ( | Qt::MouseButton | button | ) | const |
Returns the mouse cursor position in scene coordinates where the specified button was clicked.
Definition at line 491 of file qgraphicssceneevent.cpp.
QPoint QGraphicsSceneMouseEvent::buttonDownScreenPos | ( | Qt::MouseButton | button | ) | const |
Returns the mouse cursor position in screen coordinates where the specified button was clicked.
Definition at line 512 of file qgraphicssceneevent.cpp.
Qt::MouseButtons QGraphicsSceneMouseEvent::buttons | ( | ) | const |
Returns the combination of mouse buttons that were pressed at the time the event was sent.
Definition at line 600 of file qgraphicssceneevent.cpp.
Qt::MouseEventFlags QGraphicsSceneMouseEvent::flags | ( | ) | const |
Returns the mouse event flags.
The mouse event flags provide additional information about a mouse event.
Definition at line 685 of file qgraphicssceneevent.cpp.
QPointF QGraphicsSceneMouseEvent::lastPos | ( | ) | const |
Returns the last recorded mouse cursor position in item coordinates.
Definition at line 533 of file qgraphicssceneevent.cpp.
QPointF QGraphicsSceneMouseEvent::lastScenePos | ( | ) | const |
Returns the last recorded mouse cursor position in scene coordinates. The last recorded position is the position of the previous mouse event received by the view that created the event.
Definition at line 556 of file qgraphicssceneevent.cpp.
QPoint QGraphicsSceneMouseEvent::lastScreenPos | ( | ) | const |
Returns the last recorded mouse cursor position in screen coordinates. The last recorded position is the position of the previous mouse event received by the view that created the event.
Definition at line 579 of file qgraphicssceneevent.cpp.
Qt::KeyboardModifiers QGraphicsSceneMouseEvent::modifiers | ( | ) | const |
Returns the keyboard modifiers in use at the time the event was sent.
Definition at line 641 of file qgraphicssceneevent.cpp.
QPointF QGraphicsSceneMouseEvent::pos | ( | ) | const |
Returns the mouse cursor position in item coordinates.
Definition at line 409 of file qgraphicssceneevent.cpp.
QPointF QGraphicsSceneMouseEvent::scenePos | ( | ) | const |
Returns the mouse cursor position in scene coordinates.
Definition at line 429 of file qgraphicssceneevent.cpp.
QPoint QGraphicsSceneMouseEvent::screenPos | ( | ) | const |
Returns the mouse cursor position in screen coordinates.
Definition at line 449 of file qgraphicssceneevent.cpp.
void QGraphicsSceneMouseEvent::setButton | ( | Qt::MouseButton | button | ) |
void QGraphicsSceneMouseEvent::setButtonDownPos | ( | Qt::MouseButton | button, |
const QPointF & | pos | ||
) |
void QGraphicsSceneMouseEvent::setButtonDownScenePos | ( | Qt::MouseButton | button, |
const QPointF & | pos | ||
) |
void QGraphicsSceneMouseEvent::setButtonDownScreenPos | ( | Qt::MouseButton | button, |
const QPoint & | pos | ||
) |
void QGraphicsSceneMouseEvent::setButtons | ( | Qt::MouseButtons | buttons | ) |
void QGraphicsSceneMouseEvent::setFlags | ( | Qt::MouseEventFlags | flags | ) |
Definition at line 695 of file qgraphicssceneevent.cpp.
void QGraphicsSceneMouseEvent::setModifiers | ( | Qt::KeyboardModifiers | modifiers | ) |
void QGraphicsSceneMouseEvent::setSource | ( | Qt::MouseEventSource | source | ) |
Definition at line 669 of file qgraphicssceneevent.cpp.
Qt::MouseEventSource QGraphicsSceneMouseEvent::source | ( | ) | const |
Returns information about the mouse event source.
The mouse event source can be used to distinguish between genuine and artificial mouse events. The latter are events that are synthesized from touch events by the operating system or Qt itself.
Definition at line 659 of file qgraphicssceneevent.cpp.