25#include <QAbstractButton>
30 , mCursor( Qt::CrossCursor )
43 return mCanvas->getCoordinateTransform()->toMapCoordinates( point );
48 return mCanvas->mapSettings().layerToMapCoordinates(
layer, point );
59 return mCanvas->mapSettings().mapToLayerCoordinates(
layer, point );
64 return mCanvas->mapSettings().mapToLayerCoordinates(
layer, point );
69 return mCanvas->mapSettings().layerToMapCoordinates(
layer, point );
74 return mCanvas->mapSettings().mapToLayerCoordinates(
layer, rect );
79 qreal x = point.
x(), y = point.
y();
80 mCanvas->getCoordinateTransform()->transformInPlace( x, y );
81 return QPoint( std::round( x ), std::round( y ) );
134 disconnect(
mAction, &QObject::destroyed,
this, &QgsMapTool::actionDestroyed );
137 connect(
mAction, &QObject::destroyed,
this, &QgsMapTool::actionDestroyed );
140void QgsMapTool::actionDestroyed()
static const double DEFAULT_SEARCH_RADIUS_MM
Identify search radius in mm.
Map canvas is a class for displaying all GIS data types on a canvas.
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
Base class for all map layer types.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
The QgsMapSettings class contains configuration for rendering of the map.
double mapUnitsPerPixel() const
Returns the current map units per pixel.
A class to represent a 2D point.
Point geometry type, with support for z-dimension and m-values.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
double scaleFactor() const
Returns the scaling factor for the render to convert painter units to physical sizes.
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
static QgsRenderContext fromMapSettings(const QgsMapSettings &mapSettings)
create initialized QgsRenderContext instance from given QgsMapSettings
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.
#define QgsDebugMsgLevel(str, level)