Skip to content
Permalink
Browse files

Disable current cell on editing off

because otherwise on single cell change the change would not been stored in mEditBuffer

fixes #15975

(cherry-picked from 51ee713)
  • Loading branch information
signedav committed Dec 4, 2018
1 parent ee25bb4 commit 8a47643aa797d6731e7c796360c2cce43e412ffc
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 8a47643

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