show selected selection or measure tool in toolbutton

git-svn-id: http://svn.osgeo.org/qgis/trunk@14102 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2010-08-17 23:34:21 +00:00
parent 621196077a
commit 64e028bbf1
2 changed files with 14 additions and 0 deletions

View File

@ -1720,6 +1720,7 @@ void QgisApp::createToolBars()
menu->addAction( mActionSelectRadius );
bt->setDefaultAction( mActionSelect );
mAttributesToolBar->addWidget( bt );
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
mAttributesToolBar->addAction( mActionDeselectAll );
mAttributesToolBar->addAction( mActionOpenTable );
@ -1733,6 +1734,7 @@ void QgisApp::createToolBars()
menu->addAction( mActionMeasureAngle );
bt->setDefaultAction( mActionMeasure );
mAttributesToolBar->addWidget( bt );
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
mAttributesToolBar->addAction( mActionMapTips );
mAttributesToolBar->addAction( mActionShowBookmarks );
@ -7026,3 +7028,12 @@ void QgisApp::completeInitialization()
{
emit initializationCompleted();
}
void QgisApp::toolButtonActionTriggered( QAction *action )
{
QToolButton *bt = qobject_cast<QToolButton *>( sender() );
if ( !bt )
return;
bt->setDefaultAction( action );
}

View File

@ -437,6 +437,9 @@ class QgisApp : public QMainWindow
void namSslErrors( QNetworkReply *reply, const QList<QSslError> &errors );
#endif
//! update default action of toolbutton
void toolButtonActionTriggered( QAction * );
protected:
//! Handle state changes (WindowTitleChange)