Qt 4.8
|
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework. More...
#include <qgraphicssceneevent.h>
Public Functions | |
Qt::MouseButton | button () const |
Returns the mouse button (if any) that caused the event. More... | |
QPointF | buttonDownPos (Qt::MouseButton button) const |
Returns the mouse cursor position in item coordinates where the specified button was clicked. More... | |
QPointF | buttonDownScenePos (Qt::MouseButton button) const |
Returns the mouse cursor position in scene coordinates where the specified button was clicked. More... | |
QPoint | buttonDownScreenPos (Qt::MouseButton button) const |
Returns the mouse cursor position in screen coordinates where the specified button was clicked. More... | |
Qt::MouseButtons | buttons () const |
Returns the combination of mouse buttons that were pressed at the time the event was sent. More... | |
QPointF | lastPos () const |
Returns the last recorded mouse cursor position in item coordinates. More... | |
QPointF | lastScenePos () const |
Returns the last recorded mouse cursor position in scene coordinates. More... | |
QPoint | lastScreenPos () const |
Returns the last recorded mouse cursor position in screen coordinates. More... | |
Qt::KeyboardModifiers | modifiers () const |
Returns the keyboard modifiers in use at the time the event was sent. More... | |
QPointF | pos () const |
Returns the mouse cursor position in item coordinates. More... | |
QGraphicsSceneMouseEvent (Type type=None) | |
Constructs a generic graphics scene mouse event of the specified type. More... | |
QPointF | scenePos () const |
Returns the mouse cursor position in scene coordinates. More... | |
QPoint | screenPos () const |
Returns the mouse cursor position in screen coordinates. More... | |
void | setButton (Qt::MouseButton button) |
void | setButtonDownPos (Qt::MouseButton button, const QPointF &pos) |
void | setButtonDownScenePos (Qt::MouseButton button, const QPointF &pos) |
void | setButtonDownScreenPos (Qt::MouseButton button, const QPoint &pos) |
void | setButtons (Qt::MouseButtons buttons) |
void | setLastPos (const QPointF &pos) |
void | setLastScenePos (const QPointF &pos) |
void | setLastScreenPos (const QPoint &pos) |
void | setModifiers (Qt::KeyboardModifiers modifiers) |
void | setPos (const QPointF &pos) |
void | setScenePos (const QPointF &pos) |
void | setScreenPos (const QPoint &pos) |
~QGraphicsSceneMouseEvent () | |
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 QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
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 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 85 of file qgraphicssceneevent.h.
Constructs a generic graphics scene mouse event of the specified type.
Definition at line 406 of file qgraphicssceneevent.cpp.
QGraphicsSceneMouseEvent::~QGraphicsSceneMouseEvent | ( | ) |
Qt::MouseButton QGraphicsSceneMouseEvent::button | ( | ) | const |
Returns the mouse button (if any) that caused the event.
Definition at line 634 of file qgraphicssceneevent.cpp.
Referenced by QDeclarativeFlickablePrivate::captureDelayedPress(), cloneEvent(), QGraphicsItem::mousePressEvent(), QGraphicsScenePrivate::mousePressEventHandler(), QDeclarativeTextInput::mouseReleaseEvent(), QDeclarativeTextEdit::mouseReleaseEvent(), QGraphicsItem::mouseReleaseEvent(), QGraphicsTextItem::mouseReleaseEvent(), QTextControl::processEvent(), QLineControl::processEvent(), QGraphicsScenePrivate::sendMouseEvent(), QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(), setButton(), and QGraphicsWidgetPrivate::windowFrameMousePressEvent().
QPointF QGraphicsSceneMouseEvent::buttonDownPos | ( | Qt::MouseButton | button | ) | const |
Returns the mouse cursor position in item coordinates where the specified button was clicked.
Definition at line 484 of file qgraphicssceneevent.cpp.
Referenced by QDeclarativeFlickablePrivate::captureDelayedPress(), cloneEvent(), QGraphicsItemPrivate::remapItemPos(), QDeclarativePathView::sendMouseEvent(), QDeclarativeMouseArea::sendMouseEvent(), QDeclarativeFlickable::sendMouseEvent(), and QDeclarativePinchArea::sendMouseEvent().
QPointF QGraphicsSceneMouseEvent::buttonDownScenePos | ( | Qt::MouseButton | button | ) | const |
Returns the mouse cursor position in scene coordinates where the specified button was clicked.
Definition at line 505 of file qgraphicssceneevent.cpp.
Referenced by QDeclarativeFlickablePrivate::captureDelayedPress(), QGraphicsItem::mouseMoveEvent(), and QGraphicsWidgetPrivate::windowFrameMouseMoveEvent().
QPoint QGraphicsSceneMouseEvent::buttonDownScreenPos | ( | Qt::MouseButton | button | ) | const |
Returns the mouse cursor position in screen coordinates where the specified button was clicked.
Definition at line 526 of file qgraphicssceneevent.cpp.
Referenced by QDeclarativeFlickablePrivate::captureDelayedPress(), cloneEvent(), and QGraphicsItem::mouseMoveEvent().
Qt::MouseButtons QGraphicsSceneMouseEvent::buttons | ( | ) | const |
Returns the combination of mouse buttons that were pressed at the time the event was sent.
Definition at line 614 of file qgraphicssceneevent.cpp.
Referenced by QDeclarativeFlickablePrivate::captureDelayedPress(), cloneEvent(), QGraphicsScene::mouseMoveEvent(), QGraphicsItem::mouseMoveEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsTextItem::mousePressEvent(), QGraphicsView::mouseReleaseEvent(), QGraphicsScene::mouseReleaseEvent(), QGraphicsItem::mouseReleaseEvent(), QGraphicsTextItem::mouseReleaseEvent(), QTextControl::processEvent(), QLineControl::processEvent(), QGraphicsItemPrivate::remapItemPos(), QDeclarativePathView::sendMouseEvent(), QDeclarativeMouseArea::sendMouseEvent(), QDeclarativeFlickable::sendMouseEvent(), QGraphicsScenePrivate::sendMouseEvent(), QDeclarativePinchArea::sendMouseEvent(), QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(), setButtons(), QGraphicsScenePrivate::storeMouseButtonsForMouseGrabber(), and QGraphicsWidgetPrivate::windowFrameMouseMoveEvent().
QPointF QGraphicsSceneMouseEvent::lastPos | ( | ) | const |
Returns the last recorded mouse cursor position in item coordinates.
Definition at line 547 of file qgraphicssceneevent.cpp.
Referenced by _q_hoverFromMouseEvent(), QDeclarativeFlickablePrivate::captureDelayedPress(), and cloneEvent().
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 570 of file qgraphicssceneevent.cpp.
Referenced by _q_hoverFromMouseEvent(), QDeclarativeFlickablePrivate::captureDelayedPress(), cloneEvent(), QDeclarativePathView::sendMouseEvent(), QDeclarativeMouseArea::sendMouseEvent(), QDeclarativeFlickable::sendMouseEvent(), QGraphicsScenePrivate::sendMouseEvent(), and QDeclarativePinchArea::sendMouseEvent().
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 593 of file qgraphicssceneevent.cpp.
Referenced by _q_hoverFromMouseEvent(), QDeclarativeFlickablePrivate::captureDelayedPress(), and cloneEvent().
Qt::KeyboardModifiers QGraphicsSceneMouseEvent::modifiers | ( | ) | const |
Returns the keyboard modifiers in use at the time the event was sent.
Definition at line 655 of file qgraphicssceneevent.cpp.
Referenced by _q_hoverFromMouseEvent(), QDeclarativeFlickablePrivate::captureDelayedPress(), cloneEvent(), QTextControl::processEvent(), QLineControl::processEvent(), and setModifiers().
QPointF QGraphicsSceneMouseEvent::pos | ( | ) | const |
Returns the mouse cursor position in item coordinates.
Definition at line 423 of file qgraphicssceneevent.cpp.
Referenced by _q_hoverFromMouseEvent(), QGraphicsTextItemPrivate::_q_mouseOnEdge(), QDeclarativeFlickablePrivate::captureDelayedPress(), cloneEvent(), QDeclarativePathViewPrivate::handleMouseMoveEvent(), QDeclarativeFlickablePrivate::handleMouseMoveEvent(), QDeclarativePathViewPrivate::handleMousePressEvent(), QDeclarativeFlickablePrivate::handleMouseReleaseEvent(), QDeclarativeTextInput::mouseDoubleClickEvent(), QDeclarativeTextInput::mouseMoveEvent(), QDeclarativeText::mousePressEvent(), QDeclarativeTextInput::mousePressEvent(), QGraphicsItem::mousePressEvent(), QDeclarativeText::mouseReleaseEvent(), QDeclarativeTextInput::mouseReleaseEvent(), QDeclarativeTextEdit::mouseReleaseEvent(), QGraphicsTextItem::mouseReleaseEvent(), QTextControl::processEvent(), QLineControl::processEvent(), QGraphicsItemPrivate::remapItemPos(), QDeclarativeTextInputPrivate::sendMouseEventToInputContext(), QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(), setLastPos(), setLastScenePos(), setLastScreenPos(), setPos(), setScenePos(), setScreenPos(), QGraphicsWidgetPrivate::windowFrameMouseMoveEvent(), and QGraphicsWidgetPrivate::windowFrameMousePressEvent().
QPointF QGraphicsSceneMouseEvent::scenePos | ( | ) | const |
Returns the mouse cursor position in scene coordinates.
Definition at line 443 of file qgraphicssceneevent.cpp.
Referenced by _q_hoverFromMouseEvent(), QDeclarativeFlickablePrivate::captureDelayedPress(), cloneEvent(), QGraphicsScene::event(), QDeclarativeMouseArea::mouseMoveEvent(), QGraphicsItem::mouseMoveEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsScenePrivate::mousePressEventHandler(), QGraphicsItem::mouseReleaseEvent(), QDeclarativePathView::sendMouseEvent(), QDeclarativeMouseArea::sendMouseEvent(), QDeclarativeFlickable::sendMouseEvent(), QGraphicsScenePrivate::sendMouseEvent(), QDeclarativePinchArea::sendMouseEvent(), and QGraphicsScenePrivate::storeMouseButtonsForMouseGrabber().
QPoint QGraphicsSceneMouseEvent::screenPos | ( | ) | const |
Returns the mouse cursor position in screen coordinates.
Definition at line 463 of file qgraphicssceneevent.cpp.
Referenced by _q_hoverFromMouseEvent(), QDeclarativeFlickablePrivate::captureDelayedPress(), cloneEvent(), QGraphicsItem::mouseMoveEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsScenePrivate::mousePressEventHandler(), QTextControl::processEvent(), QTapAndHoldGestureRecognizer::recognize(), QGraphicsScenePrivate::sendMouseEvent(), QDeclarativeTextInputPrivate::sendMouseEventToInputContext(), and QGraphicsScenePrivate::storeMouseButtonsForMouseGrabber().
void QGraphicsSceneMouseEvent::setButton | ( | Qt::MouseButton | button | ) |
Definition at line 643 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsView::mouseDoubleClickEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsView::mousePressEvent(), QGraphicsView::mouseReleaseEvent(), and QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent().
void QGraphicsSceneMouseEvent::setButtonDownPos | ( | Qt::MouseButton | button, |
const QPointF & | pos | ||
) |
Definition at line 493 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsItemPrivate::remapItemPos(), and QGraphicsScenePrivate::sendMouseEvent().
void QGraphicsSceneMouseEvent::setButtonDownScenePos | ( | Qt::MouseButton | button, |
const QPointF & | pos | ||
) |
Definition at line 514 of file qgraphicssceneevent.cpp.
Referenced by QGraphicsView::mouseDoubleClickEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsView::mousePressEvent(), QGraphicsView::mouseReleaseEvent(), and QGraphicsScenePrivate::sendMouseEvent().
void QGraphicsSceneMouseEvent::setButtonDownScreenPos | ( | Qt::MouseButton | button, |
const QPoint & | pos | ||
) |
Definition at line 535 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsView::mouseDoubleClickEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsView::mousePressEvent(), QGraphicsView::mouseReleaseEvent(), and QGraphicsScenePrivate::sendMouseEvent().
void QGraphicsSceneMouseEvent::setButtons | ( | Qt::MouseButtons | buttons | ) |
Definition at line 623 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsView::mouseDoubleClickEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsView::mousePressEvent(), QGraphicsView::mouseReleaseEvent(), and QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent().
void QGraphicsSceneMouseEvent::setLastPos | ( | const QPointF & | pos | ) |
Definition at line 556 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsItemPrivate::remapItemPos(), and QGraphicsScenePrivate::sendMouseEvent().
void QGraphicsSceneMouseEvent::setLastScenePos | ( | const QPointF & | pos | ) |
Definition at line 579 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsView::mouseDoubleClickEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsView::mousePressEvent(), and QGraphicsView::mouseReleaseEvent().
void QGraphicsSceneMouseEvent::setLastScreenPos | ( | const QPoint & | pos | ) |
Definition at line 602 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsView::mouseDoubleClickEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsView::mousePressEvent(), and QGraphicsView::mouseReleaseEvent().
void QGraphicsSceneMouseEvent::setModifiers | ( | Qt::KeyboardModifiers | modifiers | ) |
Definition at line 664 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsView::mouseDoubleClickEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsView::mousePressEvent(), QGraphicsView::mouseReleaseEvent(), and QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent().
void QGraphicsSceneMouseEvent::setPos | ( | const QPointF & | pos | ) |
Definition at line 432 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsItemPrivate::remapItemPos(), QGraphicsScenePrivate::sendMouseEvent(), and QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent().
void QGraphicsSceneMouseEvent::setScenePos | ( | const QPointF & | pos | ) |
Definition at line 452 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsView::mouseDoubleClickEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsView::mousePressEvent(), and QGraphicsView::mouseReleaseEvent().
void QGraphicsSceneMouseEvent::setScreenPos | ( | const QPoint & | pos | ) |
Definition at line 472 of file qgraphicssceneevent.cpp.
Referenced by cloneEvent(), QGraphicsView::mouseDoubleClickEvent(), QGraphicsViewPrivate::mouseMoveEventHandler(), QGraphicsView::mousePressEvent(), QGraphicsView::mouseReleaseEvent(), and QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent().