Skip to content
Permalink
Browse files

Disable view updates while reloading attribute table

Fix #12930
  • Loading branch information
m-kuhn committed Jun 12, 2015
1 parent 275194d commit fccd8e58cda97c2a11a1ad4c113ada3a21318870
@@ -336,6 +336,7 @@ void QgsAttributeTableModel::loadAttributes()
void QgsAttributeTableModel::loadLayer()
{
QgsDebugMsg( "entered." );
beginResetModel();

if ( rowCount() != 0 )
{
@@ -372,6 +373,7 @@ void QgsAttributeTableModel::loadLayer()
connect( mLayerCache, SIGNAL( invalidated() ), this, SLOT( loadLayer() ) );

mFieldCount = mAttributes.size();
endResetModel();
}

void QgsAttributeTableModel::swapRows( QgsFeatureId a, QgsFeatureId b )
@@ -620,12 +622,7 @@ void QgsAttributeTableModel::reload( const QModelIndex &index1, const QModelInde
emit dataChanged( index1, index2 );
}

void QgsAttributeTableModel::resetModel()
{
beginResetModel();
loadLayer();
endResetModel();
}


void QgsAttributeTableModel::executeAction( int action, const QModelIndex &idx ) const
{
@@ -117,8 +117,10 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel

/**
* Resets the model
*
* Alias to loadLayer()
*/
void resetModel();
inline void resetModel() { loadLayer(); }

/**
* Maps feature id to table row

0 comments on commit fccd8e5

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