[QGIS Commit] r14102 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Aug 17 19:34:21 EDT 2010


Author: jef
Date: 2010-08-17 23:34:21 +0000 (Tue, 17 Aug 2010)
New Revision: 14102

Modified:
   trunk/qgis/src/app/qgisapp.cpp
   trunk/qgis/src/app/qgisapp.h
Log:
show selected selection or measure tool in toolbutton

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2010-08-17 22:24:20 UTC (rev 14101)
+++ trunk/qgis/src/app/qgisapp.cpp	2010-08-17 23:34:21 UTC (rev 14102)
@@ -1720,6 +1720,7 @@
   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 @@
   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 @@
 {
   emit initializationCompleted();
 }
+
+void QgisApp::toolButtonActionTriggered( QAction *action )
+{
+  QToolButton *bt = qobject_cast<QToolButton *>( sender() );
+  if ( !bt )
+    return;
+
+  bt->setDefaultAction( action );
+}

Modified: trunk/qgis/src/app/qgisapp.h
===================================================================
--- trunk/qgis/src/app/qgisapp.h	2010-08-17 22:24:20 UTC (rev 14101)
+++ trunk/qgis/src/app/qgisapp.h	2010-08-17 23:34:21 UTC (rev 14102)
@@ -437,6 +437,9 @@
     void namSslErrors( QNetworkReply *reply, const QList<QSslError> &errors );
 #endif
 
+    //! update default action of toolbutton
+    void toolButtonActionTriggered( QAction * );
+
   protected:
 
     //! Handle state changes (WindowTitleChange)



More information about the QGIS-commit mailing list