Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I access the QUndoStack of a QTextDocument?

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)

like image 974
Tony the Pony Avatar asked Jun 07 '10 21:06

Tony the Pony


1 Answers

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.

like image 193
cnebrera Avatar answered Oct 06 '22 22:10

cnebrera