48 const int diffX = endViewPoint.x() - startViewPoint.x();
49 const int diffY = endViewPoint.y() - startViewPoint.y();
50 return std::abs( diffX ) >= 2 || std::abs( diffY ) >= 2;
55 if ( point.x() < rect.left() )
56 point.setX( rect.left() );
57 else if ( point.x() > rect.right() )
58 point.setX( rect.right() );
60 if ( point.y() < rect.top() )
61 point.setY( rect.top() );
62 else if ( point.y() > rect.bottom() )
63 point.setY( rect.bottom() );
76 return Qgis::PlotToolFlags();
Plot canvas is a class for displaying interactive 2d charts and plots.
virtual QgsPointXY toCanvasCoordinates(const QgsPoint &point) const
Converts a point in map coordinates to the associated canvas point.
QgsPlotTool * tool()
Returns the currently active tool.
void unsetTool(QgsPlotTool *tool)
Unset the current tool.
void willBeDeleted()
Emitted in the destructor when the canvas is about to be deleted, but is still in a perfectly valid s...
virtual QgsPoint toMapCoordinates(const QgsPointXY &point) const
Converts a point on the canvas to the associated map coordinate.
A QgsPlotMouseEvent is the result of a user interaction with the mouse on a QgsPlotCanvas.
A class to represent a 2D point.
Point geometry type, with support for z-dimension and m-values.