QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
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 ) );
128 disconnect(
mAction, &QObject::destroyed,
this, &QgsMapTool::actionDestroyed );
131 connect(
mAction, &QObject::destroyed,
this, &QgsMapTool::actionDestroyed );
134 void QgsMapTool::actionDestroyed()
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
double mapUnitsPerPixel() const
Returns the current map units per pixel.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
static QgsRenderContext fromMapSettings(const QgsMapSettings &mapSettings)
create initialized QgsRenderContext instance from given QgsMapSettings
Point geometry type, with support for z-dimension and m-values.
#define QgsDebugMsgLevel(str, level)
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
Map canvas is a class for displaying all GIS data types on a canvas.
Contains information about the context of a rendering operation.
This class is a composition of two QSettings instances:
double scaleFactor() const
Returns the scaling factor for the render to convert painter units to physical sizes.
A rectangle specified with double values.
A class to represent a 2D point.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas....
Base class for all map layer types. This is the base class for all map layer types (vector,...
static const double DEFAULT_SEARCH_RADIUS_MM
Flags which control project capabilities.
The QgsMapSettings class contains configuration for rendering of the map. The rendering itself is don...