QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
26 , mCadDockWidget( cadDockWidget )
47 if ( mSnapToLayerGridEnabled &&
layer )
59 if ( e->button() == Qt::RightButton )
87 if ( mSnapToGridCanvasItem && mSnapToLayerGridEnabled &&
layer )
112 if ( mSnapToGridCanvasItem && mSnapToLayerGridEnabled &&
layer )
133 mSnapToGridCanvasItem->
setEnabled( mSnapToLayerGridEnabled );
141 delete mSnapToGridCanvasItem;
142 mSnapToGridCanvasItem =
nullptr;
150 void QgsMapToolAdvancedDigitizing::cadPointChanged(
const QgsPointXY &point )
153 QMouseEvent *ev =
new QMouseEvent( QEvent::MouseMove,
mCanvas->mouseLastXY(), Qt::NoButton, Qt::NoButton, Qt::NoModifier );
154 qApp->postEvent(
mCanvas->viewport(), ev );
157 void QgsMapToolAdvancedDigitizing::onCurrentLayerChanged()
159 if ( mSnapToGridCanvasItem )
162 if (
layer && mSnapToLayerGridEnabled )
164 mSnapToGridCanvasItem->
setPrecision(
layer->geometryOptions()->geometryPrecision() );
171 mSnapToGridCanvasItem->
setEnabled( mSnapToLayerGridEnabled );
177 return mSnapToLayerGridEnabled;
182 mSnapToLayerGridEnabled = snapToGridEnabled;
184 if ( mSnapToGridCanvasItem )
186 mSnapToGridCanvasItem->
setEnabled( snapToGridEnabled );
QgsCoordinateReferenceSystem crs
void currentLayerChanged(QgsMapLayer *layer)
Emitted when the current layer is changed.
QgsPointXY mapPoint() const
mapPoint returns the point in coordinates
QgsPointXY snapPoint()
snapPoint will snap the points using the map canvas snapping utils configuration
const QgsCoordinateReferenceSystem & crs
Map canvas is a class for displaying all GIS data types on a canvas.
void setPrecision(double precision)
The resolution of the grid in map units.
void setEnabled(bool enabled)
Enable this item.
void snapToGrid(double precision, const QgsCoordinateReferenceSystem &crs)
Snaps the mapPoint to a grid with the given precision.
A class to represent a 2D point.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas....
Represents a vector layer which manages a vector based data sets.
Base class for all map layer types. This is the base class for all map layer types (vector,...
QgsMapLayer * currentLayer()
returns current layer (set by legend widget)
void setPoint(const QgsPointXY &point)
A point that will be highlighted on the map canvas.
Shows a grid on the map canvas given a spatial resolution.
void setCrs(const QgsCoordinateReferenceSystem &crs)
The CRS in which the grid should be calculated.