QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
A QgsModelViewMouseEvent is the result of a user interaction with the mouse on a QgsModelGraphicsView. More...
#include <qgsmodelviewmouseevent.h>
Public Member Functions | |
QgsModelViewMouseEvent (QgsModelGraphicsView *view, QMouseEvent *event, bool snaps) | |
Constructor for QgsModelViewMouseEvent. | |
bool | isSnapped () const |
Returns true if point was snapped, e.g. | |
QPointF | modelPoint () const |
Returns the event point location in model coordinates. | |
QPointF | snappedPoint () const |
Returns the snapped event point location in model coordinates. | |
void | snapPoint () |
Manually triggers a snap for the mouse event position using the model's snapper. | |
A QgsModelViewMouseEvent is the result of a user interaction with the mouse on a QgsModelGraphicsView.
It is sent whenever the user moves, clicks, releases or double clicks the mouse. In addition to the coordinates in pixel space it also knows the coordinates the model space.
Definition at line 36 of file qgsmodelviewmouseevent.h.
QgsModelViewMouseEvent::QgsModelViewMouseEvent | ( | QgsModelGraphicsView * | view, |
QMouseEvent * | event, | ||
bool | snaps | ||
) |
Constructor for QgsModelViewMouseEvent.
Should only be required to be called from the QgsModelGraphicsView.
view | The view in which the event occurred. |
event | The original mouse event |
snaps | set to true if the event should be snapped |
Definition at line 20 of file qgsmodelviewmouseevent.cpp.
|
inline |
Returns true
if point was snapped, e.g.
to grid.
Definition at line 70 of file qgsmodelviewmouseevent.h.
QPointF QgsModelViewMouseEvent::modelPoint | ( | ) | const |
Returns the event point location in model coordinates.
Definition at line 44 of file qgsmodelviewmouseevent.cpp.
|
inline |
Returns the snapped event point location in model coordinates.
The snapped point will consider all possible snapping methods, such as snapping to grid.
Definition at line 64 of file qgsmodelviewmouseevent.h.
void QgsModelViewMouseEvent::snapPoint | ( | ) |
Manually triggers a snap for the mouse event position using the model's snapper.
Definition at line 36 of file qgsmodelviewmouseevent.cpp.