We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6fd5b23 commit cddbf96Copy full SHA for cddbf96
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
@@ -917,7 +917,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
917
bool mRenderFlag = true;
918
919
//! current layer in legend
920
- QgsMapLayer *mCurrentLayer = nullptr;
+ QPointer< QgsMapLayer > mCurrentLayer;
921
922
//! graphics scene manages canvas items
923
QGraphicsScene *mScene = nullptr;
0 commit comments