We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 8075368 commit 56b6ebdCopy full SHA for 56b6ebd
src/gui/qgsmapcanvas.cpp
@@ -285,6 +285,9 @@ QgsMapLayer *QgsMapCanvas::layer( int index )
285
286
void QgsMapCanvas::setCurrentLayer( QgsMapLayer *layer )
287
{
288
+ if ( mCurrentLayer == layer )
289
+ return;
290
+
291
mCurrentLayer = layer;
292
emit currentLayerChanged( layer );
293
}
src/gui/qgsmapcanvas.h
@@ -928,7 +928,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
928
bool mRenderFlag = true;
929
930
//! current layer in legend
931
- QgsMapLayer *mCurrentLayer = nullptr;
+ QPointer< QgsMapLayer > mCurrentLayer;
932
933
//! graphics scene manages canvas items
934
QGraphicsScene *mScene = nullptr;
0 commit comments