Skip to content

Commit 4150824

Browse files
author
Hugo Mercier
committed
Snapping: destroy index on dataChanged signal
Snapping caches on layers that have been changed by the provider or by external sources are now invalidated. (cherry-picked from e6fd2e2)
1 parent 2f94c66 commit 4150824

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/core/qgspointlocator.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ QgsPointLocator::QgsPointLocator( QgsVectorLayer* layer, const QgsCoordinateRefe
628628
connect( mLayer, SIGNAL( featureAdded( QgsFeatureId ) ), this, SLOT( onFeatureAdded( QgsFeatureId ) ) );
629629
connect( mLayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( onFeatureDeleted( QgsFeatureId ) ) );
630630
connect( mLayer, SIGNAL( geometryChanged( QgsFeatureId, QgsGeometry& ) ), this, SLOT( onGeometryChanged( QgsFeatureId, QgsGeometry& ) ) );
631+
connect( mLayer, SIGNAL( dataChanged() ), this, SLOT( destroyIndex() ) );
631632
}
632633

633634

src/core/qgspointlocator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ class CORE_EXPORT QgsPointLocator : public QObject
207207

208208
protected:
209209
bool rebuildIndex( int maxFeaturesToIndex = -1 );
210+
protected slots:
210211
void destroyIndex();
211-
212212
private slots:
213213
void onFeatureAdded( QgsFeatureId fid );
214214
void onFeatureDeleted( QgsFeatureId fid );

0 commit comments

Comments
 (0)