21 :
QgsPlotMouseEvent( canvas, event->type(), event->pos(), event->button(), event->buttons(), event->modifiers() )
26 : QMouseEvent( type, pos, button, buttons, modifiers )
28 , mMapPoint( mCanvas->toMapCoordinates( pos ) )
40 if ( mHasCachedSnapResult )
49 if ( mHasCachedSnapResult )
56void QgsPlotMouseEvent::snapPoint()
58 mHasCachedSnapResult =
true;
62 mSnappedPoint = !mIsSnapped ? pos() : result;
Plot canvas is a class for displaying interactive 2d charts and plots.
virtual QgsPointXY snapToPlot(QPoint point)
Snap a canvas point to the plot.
A QgsPlotMouseEvent is the result of a user interaction with the mouse on a QgsPlotCanvas.
QgsPointXY snappedPoint()
Returns the point snapped to the plot, if possible.
QgsPoint mapPoint() const
Returns the point in map coordinates corresponding to the event.
bool isSnapped()
Returns true if the point can be snapped to the plot.
QgsPlotMouseEvent(QgsPlotCanvas *canvas, QMouseEvent *event)
Creates a new QgsPlotMouseEvent.
A class to represent a 2D point.
bool isEmpty() const
Returns true if the geometry is empty.
Point geometry type, with support for z-dimension and m-values.