Skip to content

Commit 8a47643

Browse files
committedDec 4, 2018
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)
1 parent ee25bb4 commit 8a47643

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/app/qgsattributetabledialog.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,12 @@ void QgsAttributeTableDialog::mActionToggleEditing_toggled( bool )
874874
{
875875
if ( !mLayer )
876876
return;
877+
878+
//this has to be done, because in case only one cell has been changed and is still enabled, the change
879+
//would not be added to the mEditBuffer. By disabling, it looses focus and the change will be stored.
880+
if ( mLayer->isEditable() && mMainView->tableView()->indexWidget( mMainView->tableView()->currentIndex() ) )
881+
mMainView->tableView()->indexWidget( mMainView->tableView()->currentIndex() )->setEnabled( false );
882+
877883
if ( !QgisApp::instance()->toggleEditing( mLayer ) )
878884
{
879885
// restore gui state if toggling was canceled or layer commit/rollback failed

0 commit comments

Comments
 (0)
Please sign in to comment.