19#include "moc_qgsplottool.cpp"
49 const int diffX = endViewPoint.
x() - startViewPoint.x();
50 const int diffY = endViewPoint.y() - startViewPoint.y();
51 return std::abs( diffX ) >= 2 || std::abs( diffY ) >= 2;
56 if ( point.x() < rect.left() )
57 point.setX( rect.left() );
58 else if ( point.x() > rect.right() )
59 point.setX( rect.right() );
61 if ( point.y() < rect.top() )
62 point.setY( rect.top() );
63 else if ( point.y() > rect.bottom() )
64 point.setY( rect.bottom() );
QFlags< PlotToolFlag > 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.