Skip to content

Commit

Permalink
Enable display of selection tools in Attribute toolbar
Browse files Browse the repository at this point in the history
when switching tools
  • Loading branch information
DelazJ committed Oct 3, 2017
1 parent 22d4d22 commit 4239abe
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -2305,9 +2305,27 @@ void QgisApp::createToolBars()
selectActions << mActionSelectByForm << mActionSelectByExpression << mActionSelectAll
<< mActionInvertSelection;
bt->addActions( selectActions );
bt->setDefaultAction( mActionSelectByForm );

QAction *defSelectionAction = mActionSelectByForm;
switch ( settings.value( QStringLiteral( "UI/selectionTool" ), 0 ).toInt() )
{
case 0:
defSelectionAction = mActionSelectByForm;
break;
case 1:
defSelectionAction = mActionSelectByExpression;
break;
case 2:
defSelectionAction = mActionSelectAll;
break;
case 3:
defSelectionAction = mActionInvertSelection;
break;
}
bt->setDefaultAction( defSelectionAction );
QAction *selectionAction = mAttributesToolBar->insertWidget( mActionDeselectAll, bt );
selectionAction->setObjectName( QStringLiteral( "ActionSelection" ) );
connect( bt, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );

// select tool button

Expand Down Expand Up @@ -2409,7 +2427,6 @@ void QgisApp::createToolBars()
case 4:
defAnnotationAction = mActionAnnotation;
break;

}
bt->setDefaultAction( defAnnotationAction );
QAction *annotationAction = mAttributesToolBar->addWidget( bt );
Expand Down

0 comments on commit 4239abe

Please sign in to comment.