22#include <QApplication>
23#include <QProgressDialog>
25#include "moc_qgsmapcanvassnappingutils.cpp"
38 canvasMapSettingsChanged();
39 canvasCurrentLayerChanged();
42void QgsMapCanvasSnappingUtils::canvasMapSettingsChanged()
48void QgsMapCanvasSnappingUtils::canvasTransformContextChanged()
55void QgsMapCanvasSnappingUtils::canvasCurrentLayerChanged()
57 setCurrentLayer( qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() ) );
60void QgsMapCanvasSnappingUtils::canvasMapToolChanged()
67 QApplication::setOverrideCursor( Qt::WaitCursor );
68 mProgress =
new QProgressDialog( tr(
"Indexing data…" ), QString(), 0, count, mCanvas->topLevelWidget() );
69 mProgress->setWindowModality( Qt::WindowModal );
77 mProgress->setValue( index );
78 if ( index == mProgress->maximum() )
82 QApplication::restoreOverrideCursor();
QgsMapCanvasSnappingUtils(QgsMapCanvas *canvas, QObject *parent=nullptr)
Construct map canvas snapping utils object.
void prepareIndexProgress(int index) override
Called when finished indexing a layer with snapToMap. When index == count the indexing is complete.
void prepareIndexStarting(int count) override
Called when starting to index with snapToMap - can be overridden and e.g. progress dialog can be prov...
Map canvas is a class for displaying all GIS data types on a canvas.
void extentsChanged()
Emitted when the extents of the map change.
void mapToolSet(QgsMapTool *newTool, QgsMapTool *oldTool)
Emit map tool changed with the old tool.
void currentLayerChanged(QgsMapLayer *layer)
Emitted when the current layer is changed.
void destinationCrsChanged()
Emitted when map CRS has changed.
void transformContextChanged()
Emitted when the canvas transform context is changed.
void layersChanged()
Emitted when a new set of layers has been received.
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
Used for settings introspection and collects all QgsSettingsEntry instances of core.
static const QgsSettingsEntryBool * settingsDigitizingSnapInvisibleFeature
Settings entry digitizing snap invisible feature.
void setMapSettings(const QgsMapSettings &settings)
Assign current map settings to the utils - used for conversion between screen coords to map coords.
void clearAllLocators()
Deletes all existing locators (e.g. when destination CRS has changed and we need to reindex).
void setCurrentLayer(QgsVectorLayer *layer)
Sets current layer so that if mode is SnapCurrentLayer we know which layer to use.
QgsSnappingUtils(QObject *parent=nullptr, bool enableSnappingForInvisibleFeature=true)
Constructor for QgsSnappingUtils.
void setEnableSnappingForInvisibleFeature(bool enable)
Set if invisible features must be snapped or not.