[QGIS Commit] r14266 - trunk/qgis/src/app/legend

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Sep 20 14:59:10 EDT 2010


Author: jef
Date: 2010-09-20 18:59:10 +0000 (Mon, 20 Sep 2010)
New Revision: 14266

Modified:
   trunk/qgis/src/app/legend/qgslegend.cpp
Log:
fix #3021

Modified: trunk/qgis/src/app/legend/qgslegend.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegend.cpp	2010-09-20 12:23:08 UTC (rev 14265)
+++ trunk/qgis/src/app/legend/qgslegend.cpp	2010-09-20 18:59:10 UTC (rev 14266)
@@ -218,8 +218,12 @@
   else if ( e->button() == Qt::RightButton )
   {
     QTreeWidgetItem* item = itemAt( e->pos() );
-    if ( item == currentItem() )
+    if ( !item || item == currentItem() )
+    {
+      if ( !item )
+        setCurrentItem( 0 );
       handleRightClickEvent( item, e->globalPos() );
+    }
   }
   QTreeWidget::mousePressEvent( e );
 }                               // contentsMousePressEvent



More information about the QGIS-commit mailing list