25 #include <QAbstractButton> 30 , mCursor( Qt::CrossCursor )
77 qreal x = point.
x(), y = point.
y();
79 return QPoint( std::round( x ), std::round( y ) );
93 QgsDebugMsg( QStringLiteral(
"Cursor has been set" ) );
117 disconnect(
mAction, &QObject::destroyed,
this, &QgsMapTool::actionDestroyed );
120 connect(
mAction, &QObject::destroyed,
this, &QgsMapTool::actionDestroyed );
123 void QgsMapTool::actionDestroyed()
void unsetMapTool(QgsMapTool *mapTool)
Unset the current map tool or last non zoom tool.
A rectangle specified with double values.
Base class for all map layer types.
This class is a composition of two QSettings instances:
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
A class to represent a 2D point.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
QgsMapTool * mapTool()
Returns the currently active tool.
Map canvas is a class for displaying all GIS data types on a canvas.
The QgsMapSettings class contains configuration for rendering of the map.
void transformInPlace(double &x, double &y) const
Transform device coordinates to map coordinates.
static const double DEFAULT_SEARCH_RADIUS_MM
Identify search radius in mm.
double mapUnitsPerPixel() const
Returns current map units per pixel.
Point geometry type, with support for z-dimension and m-values.
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
Contains information about the context of a rendering operation.
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
QgsPointXY layerToMapCoordinates(const QgsMapLayer *layer, QgsPointXY point) const
transform point coordinates from layer's CRS to output CRS
static QgsRenderContext fromMapSettings(const QgsMapSettings &mapSettings)
create initialized QgsRenderContext instance from given QgsMapSettings
const QgsMapToPixel * getCoordinateTransform()
Gets the current coordinate transform.
QgsPointXY mapToLayerCoordinates(const QgsMapLayer *layer, QgsPointXY point) const
transform point coordinates from output CRS to layer's CRS
double scaleFactor() const
Returns the scaling factor for the render to convert painter units to physical sizes.
QgsPointXY toMapCoordinates(int x, int y) const
Transform device coordinates to map (world) coordinates.