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

CLONE -Extend the Undo/Redo framework to handle failing commands

    XMLWordPrintable

Details

    Description

      As reported in 185538 and 174271 the Qt's Undo Framework doesnt support failing commands.

      Here is the scenario:

      Implement Undo/Redo for a database.
      Imagine a Command called "InsertRow".

      At the moment, if the redo() function of this command fails, there is no elegant way of supporting this. It still gets added to the UndoStack. A workaround is to have an internal flag in the command itself so that when the undo() is called for this command it will basically resolve into a NOP, but it's still in the stack.

      One proper solution could be to let the void redo() function return a bool instead, and if this bool is false the UndoStack will not add it to the stack but actually delete it. (This would all happen in the push(...) function of the UndoStack).

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              odt Reto Tschofenig, ODT Informatik GmbH
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes