[QGIS Commit] r8786 - branches/advanced_printing_branch/src/app/composer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Jul 15 12:09:43 EDT 2008


Author: mhugent
Date: 2008-07-15 12:09:43 -0400 (Tue, 15 Jul 2008)
New Revision: 8786

Modified:
   branches/advanced_printing_branch/src/app/composer/qgscomposerlegendwidget.cpp
   branches/advanced_printing_branch/src/app/composer/qgslegendmodel.cpp
Log:
Possibility to delete whole layers in composer legend

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposerlegendwidget.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposerlegendwidget.cpp	2008-07-15 13:37:37 UTC (rev 8785)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposerlegendwidget.cpp	2008-07-15 16:09:43 UTC (rev 8786)
@@ -304,14 +304,11 @@
     }
 
   QModelIndex parentIndex = currentIndex.parent();
-  if(!parentIndex.isValid())
-    {
-      return;
-    }
   
   itemModel->removeRow(currentIndex.row(), parentIndex);
   if(mLegend)
     {
+      mLegend->adjustBoxSize();
       mLegend->update();
     }
 }

Modified: branches/advanced_printing_branch/src/app/composer/qgslegendmodel.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgslegendmodel.cpp	2008-07-15 13:37:37 UTC (rev 8785)
+++ branches/advanced_printing_branch/src/app/composer/qgslegendmodel.cpp	2008-07-15 16:09:43 UTC (rev 8786)
@@ -54,7 +54,8 @@
 
       //addItem for layer
       QStandardItem* layerItem = new QStandardItem(currentLayer->name());
-      layerItem->setFlags(Qt::ItemIsEnabled);
+      layerItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
+     
       invisibleRootItem()->setChild (invisibleRootItem()->rowCount(), layerItem);
 
       switch(currentLayer->type())



More information about the QGIS-commit mailing list