Skip to content
Permalink
Browse files

Update Attr Table after field calculation: fixes #17312

  • Loading branch information
luipir authored and m-kuhn committed Oct 31, 2017
1 parent 5f750e7 commit 192d6f93d03efa785d9d96e04a71afd82dcbc1b2
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/app/qgsattributetabledialog.cpp
@@ -533,10 +533,17 @@ void QgsAttributeTableDialog::runFieldCalculation( QgsVectorLayer *layer, const
{
QMessageBox::critical( nullptr, tr( "Error" ), tr( "An error occurred while evaluating the calculation string:\n%1" ).arg( error ) );
mLayer->destroyEditCommand();
return;
}
else
{
mLayer->endEditCommand();

mLayer->endEditCommand();
// refresh table with updated values
// fixes https://issues.qgis.org/issues/17312
QgsAttributeTableModel *masterModel = mMainView->masterModel();
int modelColumn = masterModel->fieldCol( fieldindex );
masterModel->reload( masterModel->index( 0, modelColumn ), masterModel->index( masterModel->rowCount() - 1, modelColumn ) );
}
}

void QgsAttributeTableDialog::replaceSearchWidget( QWidget *oldw, QWidget *neww )

0 comments on commit 192d6f9

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