How can I access the QUndoStack of a QTextDocument?
(For example, I want to be able to add custom QUndoCommand objects to the document's undo stack)
I have been reading the documentation and it doesn't seems to be a way to get the QUndoStack directly for the Widget.
Probably the only way is to create your own QUndoStack object and manually add the changes and then re-implement the redo() / undo() slots. I would have a look to the source code, you can probably get most of the code you need from there to store the changes in QTextDocument.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With