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

Allow reimplementation of QUndoStack::setIndex

    XMLWordPrintable

Details

    Description

      One use-case for QUndoStack is that each QUndoCommand corresponds to a SQL update-statement; in this case, it would be good if a list of undo-operations would be handled as a transaction - the transaction starts when setIndex is called, and is commited when setIndex is done. This is right now difficult to implement, as setIndex is not virtual (but is called by QUndoView), and QUndoCommand::undo/redo don't return a bool.

      The only point where this can be implemented right now is QUndoCommand::undo/redo, which however doesn't know enough about the context in which they are invoked (i.e. as part of a single undo-operation, or of a chain of undos). This requires the use of static variables and 0-timer based commits, which is not very clean. A virtual QUndoStack::setIndex would simplify this.

      Attachments

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

        Activity

          People

            bjnilsen Bjørn Erik Nilsen
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes