diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 4ee08f3bf5b..e1ed605a85b 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -5591,6 +5591,12 @@ bool QgisApp::addProject( const QString &projectFile ) mActionFilterLegend->setChecked( QgsProject::instance()->readBoolEntry( QStringLiteral( "Legend" ), QStringLiteral( "filterByMap" ) ) ); + // Select the first layer + if ( mLayerTreeView->layerTreeModel()->rootGroup()->findLayers().count() > 0 ) + { + mLayerTreeView->setCurrentLayer( mLayerTreeView->layerTreeModel()->rootGroup()->findLayers().at( 0 )->layer() ); + } + QgsSettings settings; #ifdef WITH_BINDINGS