Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
show selected selection or measure tool in toolbutton
git-svn-id: http://svn.osgeo.org/qgis/trunk@14102 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 17, 2010
1 parent 6211960 commit 64e028b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down Expand Up @@ -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 );
}
3 changes: 3 additions & 0 deletions src/app/qgisapp.h
Expand Up @@ -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)
Expand Down

0 comments on commit 64e028b

Please sign in to comment.