6 #include <QApplication> 7 #include <QProgressDialog> 14 connect( canvas, SIGNAL( extentsChanged() ),
this, SLOT( canvasMapSettingsChanged() ) );
15 connect( canvas, SIGNAL( destinationCrsChanged() ),
this, SLOT( canvasMapSettingsChanged() ) );
16 connect( canvas, SIGNAL( layersChanged() ),
this, SLOT( canvasMapSettingsChanged() ) );
17 connect( canvas, SIGNAL( currentLayerChanged(
QgsMapLayer* ) ),
this, SLOT( canvasCurrentLayerChanged() ) );
18 canvasMapSettingsChanged();
19 canvasCurrentLayerChanged();
22 void QgsMapCanvasSnappingUtils::canvasMapSettingsChanged()
27 void QgsMapCanvasSnappingUtils::canvasCurrentLayerChanged()
34 QApplication::setOverrideCursor( Qt::WaitCursor );
35 mProgress =
new QProgressDialog(
tr(
"Indexing data..." ), QString(), 0, count, mCanvas->topLevelWidget() );
36 mProgress->setWindowModality( Qt::WindowModal );
41 mProgress->setValue( index );
42 if ( index == mProgress->maximum() )
46 QApplication::restoreOverrideCursor();
Base class for all map layer types.
void setCurrentLayer(QgsVectorLayer *layer)
set current layer so that if mode is SnapCurrentLayer we know which layer to use
virtual void prepareIndexStarting(int count) override
Called when starting to index - can be overridden and e.g. progress dialog can be provided...
QgsMapCanvasSnappingUtils(QgsMapCanvas *canvas, QObject *parent=0)
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
Map canvas is a class for displaying all GIS data types on a canvas.
virtual void prepareIndexProgress(int index) override
Called when finished indexing a layer. When index == count the indexing is complete.
void setMapSettings(const QgsMapSettings &settings)
assign current map settings to the utils - used for conversion between screen coords to map coords ...
QgsMapLayer * currentLayer()
returns current layer (set by legend widget)
This class has all the configuration of snapping and can return answers to snapping queries...