20 #include <QApplication> 21 #include <QProgressDialog> 33 canvasMapSettingsChanged();
34 canvasCurrentLayerChanged();
37 void QgsMapCanvasSnappingUtils::canvasMapSettingsChanged()
42 void QgsMapCanvasSnappingUtils::canvasTransformContextChanged()
49 void QgsMapCanvasSnappingUtils::canvasCurrentLayerChanged()
56 QApplication::setOverrideCursor( Qt::WaitCursor );
57 mProgress =
new QProgressDialog( tr(
"Indexing data…" ), QString(), 0, count, mCanvas->topLevelWidget() );
58 mProgress->setWindowModality( Qt::WindowModal );
66 mProgress->setValue( index );
67 if ( index == mProgress->maximum() )
71 QApplication::restoreOverrideCursor();
QgsMapCanvasSnappingUtils(QgsMapCanvas *canvas, QObject *parent=nullptr)
void setCurrentLayer(QgsVectorLayer *layer)
Set current layer so that if mode is SnapCurrentLayer we know which layer to use. ...
void prepareIndexStarting(int count) override
Called when starting to index - can be overridden and e.g. progress dialog can be provided...
Map canvas is a class for displaying all GIS data types on a canvas.
void clearAllLocators()
Deletes all existing locators (e.g. when destination CRS has changed and we need to reindex) ...
void prepareIndexProgress(int index) override
Called when finished indexing a layer. When index == count the indexing is complete.
void destinationCrsChanged()
Emitted when map CRS has changed.
void transformContextChanged()
Emitted when the canvas transform context is changed.
void setMapSettings(const QgsMapSettings &settings)
Assign current map settings to the utils - used for conversion between screen coords to map coords...
void currentLayerChanged(QgsMapLayer *layer)
Emitted when the current layer is changed.
QgsMapLayer * currentLayer()
returns current layer (set by legend widget)
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
This class has all the configuration of snapping and can return answers to snapping queries...
void extentsChanged()
Emitted when the extents of the map change.
void layersChanged()
Emitted when a new set of layers has been received.