18#include "moc_qgsmaptool.cpp"
26#include <QAbstractButton>
31 , mCursor( Qt::CrossCursor )
44 return mCanvas->getCoordinateTransform()->toMapCoordinates( point );
49 return mCanvas->mapSettings().layerToMapCoordinates(
layer, point );
60 return mCanvas->mapSettings().mapToLayerCoordinates(
layer, point );
65 return mCanvas->mapSettings().mapToLayerCoordinates(
layer, point );
70 return mCanvas->mapSettings().layerToMapCoordinates(
layer, point );
75 return mCanvas->mapSettings().mapToLayerCoordinates(
layer, rect );
80 qreal x = point.
x(), y = point.
y();
81 mCanvas->getCoordinateTransform()->transformInPlace( x, y );
82 return QPoint( std::round( x ), std::round( y ) );
135 disconnect(
mAction, &QObject::destroyed,
this, &QgsMapTool::actionDestroyed );
138 connect(
mAction, &QObject::destroyed,
this, &QgsMapTool::actionDestroyed );
141void 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)