Skip to content

Commit 4239abe

Browse files
committed
Enable display of selection tools in Attribute toolbar
when switching tools
1 parent 22d4d22 commit 4239abe

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/app/qgisapp.cpp

+19-2
Original file line numberDiff line numberDiff line change
@@ -2305,9 +2305,27 @@ void QgisApp::createToolBars()
23052305
selectActions << mActionSelectByForm << mActionSelectByExpression << mActionSelectAll
23062306
<< mActionInvertSelection;
23072307
bt->addActions( selectActions );
2308-
bt->setDefaultAction( mActionSelectByForm );
2308+
2309+
QAction *defSelectionAction = mActionSelectByForm;
2310+
switch ( settings.value( QStringLiteral( "UI/selectionTool" ), 0 ).toInt() )
2311+
{
2312+
case 0:
2313+
defSelectionAction = mActionSelectByForm;
2314+
break;
2315+
case 1:
2316+
defSelectionAction = mActionSelectByExpression;
2317+
break;
2318+
case 2:
2319+
defSelectionAction = mActionSelectAll;
2320+
break;
2321+
case 3:
2322+
defSelectionAction = mActionInvertSelection;
2323+
break;
2324+
}
2325+
bt->setDefaultAction( defSelectionAction );
23092326
QAction *selectionAction = mAttributesToolBar->insertWidget( mActionDeselectAll, bt );
23102327
selectionAction->setObjectName( QStringLiteral( "ActionSelection" ) );
2328+
connect( bt, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );
23112329

23122330
// select tool button
23132331

@@ -2409,7 +2427,6 @@ void QgisApp::createToolBars()
24092427
case 4:
24102428
defAnnotationAction = mActionAnnotation;
24112429
break;
2412-
24132430
}
24142431
bt->setDefaultAction( defAnnotationAction );
24152432
QAction *annotationAction = mAttributesToolBar->addWidget( bt );

0 commit comments

Comments
 (0)