Skip to content
Permalink
Browse files

Merge pull request #8598 from signedav/bpeditafteredit

[Backport] Release cell from focus on editing off
  • Loading branch information
elpaso committed Dec 4, 2018
2 parents ee25bb4 + 8a47643 commit 1f97c17b573eb93175412effb0dd03a8db668bad
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/app/qgsattributetabledialog.cpp
@@ -874,6 +874,12 @@ void QgsAttributeTableDialog::mActionToggleEditing_toggled( bool )
{
if ( !mLayer )
return;

//this has to be done, because in case only one cell has been changed and is still enabled, the change
//would not be added to the mEditBuffer. By disabling, it looses focus and the change will be stored.
if ( mLayer->isEditable() && mMainView->tableView()->indexWidget( mMainView->tableView()->currentIndex() ) )
mMainView->tableView()->indexWidget( mMainView->tableView()->currentIndex() )->setEnabled( false );

if ( !QgisApp::instance()->toggleEditing( mLayer ) )
{
// restore gui state if toggling was canceled or layer commit/rollback failed

0 comments on commit 1f97c17

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