QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsModelViewMouseEvent Class Reference

A mouse event which is the result of a user interaction with a QgsModelGraphicsView. More...

#include <qgsmodelviewmouseevent.h>

Inheritance diagram for QgsModelViewMouseEvent:

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.

Detailed Description

A mouse event which is the result of a user interaction with 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.

Since
QGIS 3.14

Definition at line 36 of file qgsmodelviewmouseevent.h.

Constructor & Destructor Documentation

◆ QgsModelViewMouseEvent()

QgsModelViewMouseEvent::QgsModelViewMouseEvent ( QgsModelGraphicsView * view,
QMouseEvent * event,
bool snaps )

Constructor for QgsModelViewMouseEvent.

Should only be required to be called from the QgsModelGraphicsView.

Parameters
viewThe view in which the event occurred.
eventThe original mouse event
snapsset to true if the event should be snapped

Definition at line 21 of file qgsmodelviewmouseevent.cpp.

Member Function Documentation

◆ isSnapped()

bool QgsModelViewMouseEvent::isSnapped ( ) const
inline

Returns true if point was snapped, e.g.

to grid.

See also
snappedPoint()

Definition at line 69 of file qgsmodelviewmouseevent.h.

◆ modelPoint()

QPointF QgsModelViewMouseEvent::modelPoint ( ) const

Returns the event point location in model coordinates.

Definition at line 45 of file qgsmodelviewmouseevent.cpp.

◆ snappedPoint()

QPointF QgsModelViewMouseEvent::snappedPoint ( ) const
inline

Returns the snapped event point location in model coordinates.

The snapped point will consider all possible snapping methods, such as snapping to grid.

See also
isSnapped()

Definition at line 63 of file qgsmodelviewmouseevent.h.

◆ snapPoint()

void QgsModelViewMouseEvent::snapPoint ( )

Manually triggers a snap for the mouse event position using the model's snapper.

Definition at line 37 of file qgsmodelviewmouseevent.cpp.


The documentation for this class was generated from the following files: