Skip to content

Commit 64e028b

Browse files
author
jef
committed
show selected selection or measure tool in toolbutton
git-svn-id: http://svn.osgeo.org/qgis/trunk@14102 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6211960 commit 64e028b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/app/qgisapp.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -1720,6 +1720,7 @@ void QgisApp::createToolBars()
17201720
menu->addAction( mActionSelectRadius );
17211721
bt->setDefaultAction( mActionSelect );
17221722
mAttributesToolBar->addWidget( bt );
1723+
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
17231724

17241725
mAttributesToolBar->addAction( mActionDeselectAll );
17251726
mAttributesToolBar->addAction( mActionOpenTable );
@@ -1733,6 +1734,7 @@ void QgisApp::createToolBars()
17331734
menu->addAction( mActionMeasureAngle );
17341735
bt->setDefaultAction( mActionMeasure );
17351736
mAttributesToolBar->addWidget( bt );
1737+
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
17361738

17371739
mAttributesToolBar->addAction( mActionMapTips );
17381740
mAttributesToolBar->addAction( mActionShowBookmarks );
@@ -7026,3 +7028,12 @@ void QgisApp::completeInitialization()
70267028
{
70277029
emit initializationCompleted();
70287030
}
7031+
7032+
void QgisApp::toolButtonActionTriggered( QAction *action )
7033+
{
7034+
QToolButton *bt = qobject_cast<QToolButton *>( sender() );
7035+
if ( !bt )
7036+
return;
7037+
7038+
bt->setDefaultAction( action );
7039+
}

src/app/qgisapp.h

+3
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ class QgisApp : public QMainWindow
437437
void namSslErrors( QNetworkReply *reply, const QList<QSslError> &errors );
438438
#endif
439439

440+
//! update default action of toolbutton
441+
void toolButtonActionTriggered( QAction * );
442+
440443
protected:
441444

442445
//! Handle state changes (WindowTitleChange)

0 commit comments

Comments
 (0)