Skip to content

Commit 9d88b71

Browse files
author
jef
committed
catch attribute additions and deletions in attribute table
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14799 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a88ad39 commit 9d88b71

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/app/attributetable/qgsattributetablemodel.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayer *theLayer, QObjec
3939
connect( mLayer, SIGNAL( attributeValueChanged( int, int, const QVariant& ) ), this, SLOT( attributeValueChanged( int, int, const QVariant& ) ) );
4040
connect( mLayer, SIGNAL( featureAdded( int ) ), this, SLOT( featureAdded( int ) ) );
4141
connect( mLayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) );
42+
connect( mLayer, SIGNAL( attributeAdded( int ) ), this, SLOT( attributeAdded( int ) ) );
43+
connect( mLayer, SIGNAL( attributeDeleted( int ) ), this, SLOT( attributeDeleted( int ) ) );
4244

4345
loadLayer();
4446
}
@@ -123,14 +125,16 @@ void QgsAttributeTableModel::featureAdded( int fid, bool newOperation )
123125
void QgsAttributeTableModel::attributeAdded( int idx )
124126
{
125127
QgsDebugMsg( "entered." );
126-
reload( index( 0, 0 ), index( rowCount(), columnCount() ) );
128+
loadAttributes();
129+
loadLayer();
127130
emit modelChanged();
128131
}
129132

130133
void QgsAttributeTableModel::attributeDeleted( int idx )
131134
{
132135
QgsDebugMsg( "entered." );
133-
reload( index( 0, 0 ), index( rowCount(), columnCount() ) );
136+
loadAttributes();
137+
loadLayer();
134138
emit modelChanged();
135139
}
136140

0 commit comments

Comments
 (0)