Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-40380

QUndoStack: Remove "empty" commands from the undo stack that might occur after mergeWith()

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • None

    Description

      The undo stack compression currently does not handle "empty" commands well.
      This can happen when mergeWith() is called and the user "manually" undid what he did before.

      In this case it would be nice to remove the last undo command on the stack after a successful merge that results in an empty command.

      It could be implemented by adding an isEmpty() virtual method to QUndoCommand (that is false by default) - the QUndoStack could handle this gracefully then.

      To make things worse, i cannot really workaround this, because there is no way to remove the last command on the stack, even if i called undo().

      As a workaround, it would be nice to be able to clean the undo stack of undone commands, so i also support QTBUG-15764
      (this would at least allow me to implement the desired behaviour without changing Qt source code)

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              peppe Giuseppe D'Angelo
              prade Peter Prade
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes