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

QTextDocument undo stack not exposed in QGuiPrivate

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.1.1, 6.1.2, 6.2.0 Alpha, 6.2.0 Beta1
    • GUI: Text handling
    • None
    • All

      Hello

       

      The QTextUndoCommand class itselft is "exposed" in QtGuiPrivate, but it is in its current state not really usable. We can create custom commands, but not access the commands already pushed on the stack and their content.

      When creating advanced tools based on QTextDocument, accessing such a content would be very helpful in building features without having to fork the whole QTextDocument stack.

      I suggest adding two new QTextDocumentPrivate functions:

       

      // get size of undo stack
      int undoStackSize() const { return undoStack.size(); }
      // get undo stack element
      const QTextUndoCommand & undoCommand(int idx) const { return undoStack.at(idx); }

       

      These two new private functions would allow new usages of QTextDocument, without changing the public API for the advanced users that would benefit from it.

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

            esabraha Eskil Abrahamsen Blomfeldt
            pinaraf Pierre Ducroquet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes