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

Document what should be called on a QUndoStack when "saving" in an application

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.7.0 RC
    • 5.7
    • Documentation
    • None
    • 6bcd27b957a5ffcfe7665b0979679510e3b2ae3d

    Description

      http://doc.qt.io/qt-5/qundostack.html#cleanIndex says:

      Returns the clean index. This is the index at which setClean() was called.

      A stack may not have a clean index. This happens if a document is saved, some commands are undone, then a new command is pushed. Since push() deletes all the undone commands before pushing the new command, the stack can't return to the clean state again. In this case, this function returns -1.

      This doesn't explain what to call when a document is saved. It's quite confusing.

      This seems to explain it:

      "Subsequently, if the user does something, but undoes it, the document is “clean”. That is, in the same condition as is saved. Typically, an app shows the unclean state in the title bar, for example by an asterisk in front of the document name."

      Which is confirmed here.

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes