We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86860ce commit 36988f1Copy full SHA for 36988f1
src/gui/attributetable/qgsattributetablemodel.cpp
@@ -35,6 +35,7 @@
35
QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayerCache *layerCache, QObject *parent )
36
: QAbstractTableModel( parent )
37
, mLayerCache( layerCache )
38
+ , mFieldCount( 0 )
39
, mCachedField( -1 )
40
{
41
QgsDebugMsg( "entered." );
@@ -285,9 +286,12 @@ void QgsAttributeTableModel::loadLayer()
285
286
287
288
- beginRemoveRows( QModelIndex(), 0, rowCount() - 1 );
289
- removeRows( 0, rowCount() );
290
- endRemoveRows();
+ if ( rowCount() != 0 )
+ {
291
+ beginRemoveRows( QModelIndex(), 0, rowCount() - 1 );
292
+ removeRows( 0, rowCount() );
293
+ endRemoveRows();
294
+ }
295
296
QgsFeatureIterator features = mLayerCache->getFeatures( mFeatureRequest );
297
0 commit comments