Undo/Redo best practices



  • I'm trying to understand how best to implement an undo/redo functionality for a Qt dialog box. This dialog has a number of checkboxes and text fields: of course, checkboxes are simple enough to manage with a basic Command class (using QUndoCommand for example). However, the text fields have a built-in undo/redo functionality that it would be nice to tie into since it already handles command compression, etc. Obviously it is possible for a user to edit a text field for a bit, toggle a button, edit another field, edit the original field, toggle another checkbox, etc. and the undo method needs to accommodate undoing and redoing these things in the correct order. What is the best way to handle this type of situation?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.