Skip to content
Permalink
Browse files

[attrtable] Fix column synchronization

Columns have been missing, after removing all columns and readding them
  • Loading branch information
m-kuhn committed May 18, 2013
1 parent 34c85c8 commit a98ffed2c615feae2839b5123c0e275a8cd54e04
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/gui/attributetable/qgsattributetablemodel.cpp
@@ -13,6 +13,7 @@
* *
***************************************************************************/

#include "qgsapplication.h"
#include "qgsattributetablemodel.h"
#include "qgsattributetablefiltermodel.h"

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

if ( columnCount() < attributes.size() )
if ( mFieldCount < attributes.size() )
{
ins = true;
beginInsertColumns( QModelIndex(), columnCount(), attributes.size() - 1 );
beginInsertColumns( QModelIndex(), mFieldCount, attributes.size() - 1 );
}
else if ( attributes.size() < columnCount() )
else if ( attributes.size() < mFieldCount )
{
rm = true;
beginRemoveColumns( QModelIndex(), attributes.size(), columnCount() - 1 );
beginRemoveColumns( QModelIndex(), attributes.size(), mFieldCount - 1 );
}

mFieldCount = attributes.size();

0 comments on commit a98ffed

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