Make first layer selected on project load

just spare a click
This commit is contained in:
Alessandro Pasotti 2018-03-28 08:46:53 +02:00
parent 14c057aeff
commit 9ec2d1f99b

View File

@ -5591,6 +5591,12 @@ bool QgisApp::addProject( const QString &projectFile )
mActionFilterLegend->setChecked( QgsProject::instance()->readBoolEntry( QStringLiteral( "Legend" ), QStringLiteral( "filterByMap" ) ) ); 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; QgsSettings settings;
#ifdef WITH_BINDINGS #ifdef WITH_BINDINGS