Skip to content

Commit cc7c935

Browse files
authoredMar 28, 2018
Merge pull request #6698 from elpaso/auto-select-first-layer-on-load
Make first layer selected on project load
2 parents 93a6115 + 9ec2d1f commit cc7c935

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5591,6 +5591,12 @@ bool QgisApp::addProject( const QString &projectFile )
55915591

55925592
mActionFilterLegend->setChecked( QgsProject::instance()->readBoolEntry( QStringLiteral( "Legend" ), QStringLiteral( "filterByMap" ) ) );
55935593

5594+
// Select the first layer
5595+
if ( mLayerTreeView->layerTreeModel()->rootGroup()->findLayers().count() > 0 )
5596+
{
5597+
mLayerTreeView->setCurrentLayer( mLayerTreeView->layerTreeModel()->rootGroup()->findLayers().at( 0 )->layer() );
5598+
}
5599+
55945600
QgsSettings settings;
55955601

55965602
#ifdef WITH_BINDINGS

0 commit comments

Comments
 (0)