Skip to content

Commit a98ffed

Browse files
committedMay 18, 2013
[attrtable] Fix column synchronization
Columns have been missing, after removing all columns and readding them
1 parent 34c85c8 commit a98ffed

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎src/gui/attributetable/qgsattributetablemodel.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* *
1414
***************************************************************************/
1515

16+
#include "qgsapplication.h"
1617
#include "qgsattributetablemodel.h"
1718
#include "qgsattributetablefiltermodel.h"
1819

@@ -262,15 +263,15 @@ void QgsAttributeTableModel::loadAttributes()
262263
attributes << idx;
263264
}
264265

265-
if ( columnCount() < attributes.size() )
266+
if ( mFieldCount < attributes.size() )
266267
{
267268
ins = true;
268-
beginInsertColumns( QModelIndex(), columnCount(), attributes.size() - 1 );
269+
beginInsertColumns( QModelIndex(), mFieldCount, attributes.size() - 1 );
269270
}
270-
else if ( attributes.size() < columnCount() )
271+
else if ( attributes.size() < mFieldCount )
271272
{
272273
rm = true;
273-
beginRemoveColumns( QModelIndex(), attributes.size(), columnCount() - 1 );
274+
beginRemoveColumns( QModelIndex(), attributes.size(), mFieldCount - 1 );
274275
}
275276

276277
mFieldCount = attributes.size();

0 commit comments

Comments
 (0)
Please sign in to comment.