Skip to content
Permalink
Browse files

catch attribute additions and deletions in attribute table

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14799 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Nov 29, 2010
1 parent a88ad39 commit 9d88b710c01b0466574e308d8097e9093ef7e3e8
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/app/attributetable/qgsattributetablemodel.cpp
@@ -39,6 +39,8 @@ QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayer *theLayer, QObjec
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::featureAdded( int fid, bool newOperation )
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();
}

0 comments on commit 9d88b71

Please sign in to comment.
You can’t perform that action at this time.