mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-02 00:02:12 -05:00
Fix all layers are force redrawed whenever a filter is changed in any
This commit is contained in:
parent
c16e5eec13
commit
920676b178
@ -2185,7 +2185,7 @@ void QgisApp::createActions()
|
|||||||
connect( mActionZoomActualSize, &QAction::triggered, this, &QgisApp::zoomActualSize );
|
connect( mActionZoomActualSize, &QAction::triggered, this, &QgisApp::zoomActualSize );
|
||||||
connect( mActionMapTips, &QAction::toggled, this, &QgisApp::toggleMapTips );
|
connect( mActionMapTips, &QAction::toggled, this, &QgisApp::toggleMapTips );
|
||||||
connect( mActionNewBookmark, &QAction::triggered, this, &QgisApp::newBookmark );
|
connect( mActionNewBookmark, &QAction::triggered, this, &QgisApp::newBookmark );
|
||||||
connect( mActionDraw, &QAction::triggered, this, &QgisApp::refreshMapCanvas );
|
connect( mActionDraw, &QAction::triggered, this, [this] { refreshMapCanvas( true ); } );
|
||||||
connect( mActionTextAnnotation, &QAction::triggered, this, &QgisApp::addTextAnnotation );
|
connect( mActionTextAnnotation, &QAction::triggered, this, &QgisApp::addTextAnnotation );
|
||||||
connect( mActionFormAnnotation, &QAction::triggered, this, &QgisApp::addFormAnnotation );
|
connect( mActionFormAnnotation, &QAction::triggered, this, &QgisApp::addFormAnnotation );
|
||||||
connect( mActionHtmlAnnotation, &QAction::triggered, this, &QgisApp::addHtmlAnnotation );
|
connect( mActionHtmlAnnotation, &QAction::triggered, this, &QgisApp::addHtmlAnnotation );
|
||||||
@ -9398,14 +9398,17 @@ void QgisApp::copyFeatures( QgsFeatureStore &featureStore )
|
|||||||
clipboard()->replaceWithCopyOf( featureStore );
|
clipboard()->replaceWithCopyOf( featureStore );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgisApp::refreshMapCanvas()
|
void QgisApp::refreshMapCanvas( bool redrawAllLayers )
|
||||||
{
|
{
|
||||||
const auto canvases = mapCanvases();
|
const auto canvases = mapCanvases();
|
||||||
for ( QgsMapCanvas *canvas : canvases )
|
for ( QgsMapCanvas *canvas : canvases )
|
||||||
{
|
{
|
||||||
//stop any current rendering
|
//stop any current rendering
|
||||||
canvas->stopRendering();
|
canvas->stopRendering();
|
||||||
canvas->refreshAllLayers();
|
if ( redrawAllLayers )
|
||||||
|
canvas->refreshAllLayers();
|
||||||
|
else
|
||||||
|
canvas->refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12353,7 +12356,7 @@ void QgisApp::layersWereAdded( const QList<QgsMapLayer *> &layers )
|
|||||||
if ( provider )
|
if ( provider )
|
||||||
{
|
{
|
||||||
connect( provider, &QgsDataProvider::dataChanged, layer, [layer] { layer->triggerRepaint(); } );
|
connect( provider, &QgsDataProvider::dataChanged, layer, [layer] { layer->triggerRepaint(); } );
|
||||||
connect( provider, &QgsDataProvider::dataChanged, this, &QgisApp::refreshMapCanvas );
|
connect( provider, &QgsDataProvider::dataChanged, this, [this] { refreshMapCanvas(); } );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1467,7 +1467,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
|
|||||||
void selectByForm();
|
void selectByForm();
|
||||||
|
|
||||||
//! refresh map canvas
|
//! refresh map canvas
|
||||||
void refreshMapCanvas();
|
void refreshMapCanvas( bool redrawAllLayers = false );
|
||||||
|
|
||||||
//! start "busy" progress bar
|
//! start "busy" progress bar
|
||||||
void canvasRefreshStarted();
|
void canvasRefreshStarted();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user