Skip to content

Commit

Permalink
catch attribute additions and deletions in attribute table
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14799 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 29, 2010
1 parent a88ad39 commit 9d88b71
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit 9d88b71

Please sign in to comment.