20 #include <QApplication> 21 #include <QProgressDialog> 26 , mProgress( nullptr )
28 connect( canvas, SIGNAL( extentsChanged() ),
this, SLOT( canvasMapSettingsChanged() ) );
29 connect( canvas, SIGNAL( destinationCrsChanged() ),
this, SLOT( canvasMapSettingsChanged() ) );
30 connect( canvas, SIGNAL( layersChanged() ),
this, SLOT( canvasMapSettingsChanged() ) );
31 connect( canvas, SIGNAL( currentLayerChanged(
QgsMapLayer* ) ),
this, SLOT( canvasCurrentLayerChanged() ) );
32 canvasMapSettingsChanged();
33 canvasCurrentLayerChanged();
36 void QgsMapCanvasSnappingUtils::canvasMapSettingsChanged()
41 void QgsMapCanvasSnappingUtils::canvasCurrentLayerChanged()
59 if ( index == mProgress->
maximum() )
Base class for all map layer types.
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. ...
virtual void prepareIndexStarting(int count) override
Called when starting to index - can be overridden and e.g. progress dialog can be provided...
QString tr(const char *sourceText, const char *disambiguation, int n)
Map canvas is a class for displaying all GIS data types on a canvas.
void setValue(int progress)
virtual void prepareIndexProgress(int index) override
Called when finished indexing a layer. When index == count the indexing is complete.
void setOverrideCursor(const QCursor &cursor)
void restoreOverrideCursor()
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)
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...
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)