@@ -2165,7 +2165,7 @@ void QgisApp::createActions()
2165
2165
connect( mActionZoomActualSize, &QAction::triggered, this, &QgisApp::zoomActualSize );
2166
2166
connect( mActionMapTips, &QAction::toggled, this, &QgisApp::toggleMapTips );
2167
2167
connect( mActionNewBookmark, &QAction::triggered, this, &QgisApp::newBookmark );
2168
- connect( mActionDraw, &QAction::triggered, this, &QgisApp:: refreshMapCanvas );
2168
+ connect( mActionDraw, &QAction::triggered, this, [this] { refreshMapCanvas( true ); } );
2169
2169
connect( mActionTextAnnotation, &QAction::triggered, this, &QgisApp::addTextAnnotation );
2170
2170
connect( mActionFormAnnotation, &QAction::triggered, this, &QgisApp::addFormAnnotation );
2171
2171
connect( mActionHtmlAnnotation, &QAction::triggered, this, &QgisApp::addHtmlAnnotation );
@@ -9159,13 +9159,16 @@ void QgisApp::copyFeatures( QgsFeatureStore &featureStore )
9159
9159
clipboard()->replaceWithCopyOf( featureStore );
9160
9160
}
9161
9161
9162
- void QgisApp::refreshMapCanvas()
9162
+ void QgisApp::refreshMapCanvas( bool redrawAllLayers )
9163
9163
{
9164
9164
Q_FOREACH ( QgsMapCanvas *canvas, mapCanvases() )
9165
9165
{
9166
9166
//stop any current rendering
9167
9167
canvas->stopRendering();
9168
- canvas->refreshAllLayers();
9168
+ if ( redrawAllLayers )
9169
+ canvas->refreshAllLayers();
9170
+ else
9171
+ canvas->refresh();
9169
9172
}
9170
9173
}
9171
9174
@@ -12102,7 +12105,7 @@ void QgisApp::layersWereAdded( const QList<QgsMapLayer *> &layers )
12102
12105
if ( provider )
12103
12106
{
12104
12107
connect( provider, &QgsDataProvider::dataChanged, layer, [layer] { layer->triggerRepaint(); } );
12105
- connect( provider, &QgsDataProvider::dataChanged, this, &QgisApp:: refreshMapCanvas );
12108
+ connect( provider, &QgsDataProvider::dataChanged, this, [this] { refreshMapCanvas(); } );
12106
12109
}
12107
12110
}
12108
12111
}
0 commit comments