4

In QGIS 3.18. When in Edit Mode, there does not seem to be an obvious way of undoing a single edit to the Attribute Table. For example, if I change the value of Attribute 1 for Feature A from 'XYZ' to 'ABC', I don't seem to have the option of undoing to get 'XYZ' back. The Attribute Table doesn't have an Undo button, and the Undo button for the project doesn't do anything to my Attribute Table edits, nor does Ctrl+Z.

This can be a major problem for me if I've made an editing error, I'm not sure what value was in the cell before my edit, and the only way to get it back appears to be exiting Edit mode and not saving my changes. I've lost a lot of time and work that way (yes, I could save changes after every single edit but that is not realistic or practical). [As a side note, this is especially frustrating when I accidentally click that little "X arrow" inside each cell on the right, which deletes the value of the cell. Many times I simply wish to edit the value, but end up deleting it and not being able to get it back.]

This question has been asked before: here, for example (a closed thread from many years ago). But am I mistaken, or has this issue not yet been solved?

1
  • Well, it's a question because I'm hoping that I've missed something that someone can point out to me. The thread I linked to ends with an affirmation that the functionality had been/would be added (that was long ago) so I wonder if it has actually been added but is hidden. If it just doesn't exist, then yes I should add it as a feature request...
    – pete
    Sep 12, 2021 at 23:03

1 Answer 1

5

QGIS does have support for Undo/Redo in the main window's Edit menu, and in the Digitizing toolbar (the usual curved arrow to left and right icon). While those icons and menu items are not present in the Attribute Editor window itself, you can use them to affect attribute editor changes if you navigate back to the main window while keeping the Attribute Editor window open. I have just tested with a gpkg layer and it works, except that the attribute editor may not correctly display the undo reversion has taken place until you navigate to a different record (it seems it does not receive a signal that field info has changed).

More importantly, QGIS implements an edit buffer for layer edits, so you could always shut down editing mode, not commit changes. Then you would roll back everything since the last layer (not project) save or commit.

2
  • Not sure if I followed the bit about the edit buffer (I don't want to lose edits made previously to the error), but the suggestion to click a different cell in order to see the undo effect was exactly correct, and exactly the sort of thing I suspected I was not thinking of. Thanks very much @Houska!
    – pete
    Sep 13, 2021 at 9:13
  • 1
    I opened a bug report for this: github.com/qgis/QGIS/issues/45056
    – Houska
    Sep 14, 2021 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.