QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
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;
145 void QgsMapToolAdvancedDigitizing::cadPointChanged(
const QgsPointXY &point )
148 QMouseEvent *ev =
new QMouseEvent( QEvent::MouseMove,
mCanvas->
mouseLastXY(), Qt::NoButton, Qt::NoButton, Qt::NoModifier );
149 qApp->postEvent(
mCanvas->viewport(), ev );
152 void QgsMapToolAdvancedDigitizing::onCurrentLayerChanged()
154 if ( mSnapToGridCanvasItem )
157 if ( layer && mSnapToLayerGridEnabled )
160 mSnapToGridCanvasItem->
setCrs( layer->
crs() );
166 mSnapToGridCanvasItem->
setEnabled( mSnapToLayerGridEnabled );
172 return mSnapToLayerGridEnabled;
177 mSnapToLayerGridEnabled = snapToGridEnabled;
179 if ( mSnapToGridCanvasItem )
181 mSnapToGridCanvasItem->
setEnabled( snapToGridEnabled );
QgsCoordinateReferenceSystem crs
void currentLayerChanged(QgsMapLayer *layer)
Emitted when the current layer is changed.
double geometryPrecision() const
The precision in which geometries on this layer should be saved.
QgsPointXY mapPoint() const
mapPoint returns the point in coordinates
QPoint mouseLastXY()
returns last position of mouse cursor
QgsPointXY snapPoint()
snapPoint will snap the points using the map canvas snapping utils configuration
const QgsCoordinateReferenceSystem & crs
QgsGeometryOptions * geometryOptions() const
Configuration and logic to apply automatically on any edit happening on this layer.
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.
void setPoint(const QgsPointXY &point)
A point that will be highlighted on the map canvas.
void setCrs(const QgsCoordinateReferenceSystem &crs)
The CRS in which the grid should be calculated.