[QGIS Commit] r14799 - trunk/qgis/src/app/attributetable

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Nov 29 15:40:58 EST 2010


Author: jef
Date: 2010-11-29 12:40:58 -0800 (Mon, 29 Nov 2010)
New Revision: 14799

Modified:
   trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp
Log:
catch attribute additions and deletions in attribute table

Modified: trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp	2010-11-29 20:40:51 UTC (rev 14798)
+++ trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp	2010-11-29 20:40:58 UTC (rev 14799)
@@ -39,6 +39,8 @@
   connect( mLayer, SIGNAL( attributeValueChanged( int, int, const QVariant& ) ), this, SLOT( attributeValueChanged( int, int, const QVariant& ) ) );
   connect( mLayer, SIGNAL( featureAdded( int ) ), this, SLOT( featureAdded( int ) ) );
   connect( mLayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) );
+  connect( mLayer, SIGNAL( attributeAdded( int ) ), this, SLOT( attributeAdded( int ) ) );
+  connect( mLayer, SIGNAL( attributeDeleted( int ) ), this, SLOT( attributeDeleted( int ) ) );
 
   loadLayer();
 }
@@ -123,14 +125,16 @@
 void QgsAttributeTableModel::attributeAdded( int idx )
 {
   QgsDebugMsg( "entered." );
-  reload( index( 0, 0 ), index( rowCount(), columnCount() ) );
+  loadAttributes();
+  loadLayer();
   emit modelChanged();
 }
 
 void QgsAttributeTableModel::attributeDeleted( int idx )
 {
   QgsDebugMsg( "entered." );
-  reload( index( 0, 0 ), index( rowCount(), columnCount() ) );
+  loadAttributes();
+  loadLayer();
   emit modelChanged();
 }
 



More information about the QGIS-commit mailing list