PDA

View Full Version : QTextDocument - how to limit maximum undo/redo steps



lukass
30th October 2010, 14:04
Hello.

Qt have:

int QTextDocument::availableRedoSteps () const
int QTextDocument::availableUndoSteps () const
but how can I set maximum undo/redo steps? Is it possible at all?

wysota
30th October 2010, 15:51
You can probably hack into the undo/redo framework using QObject::findChild() but first you have to check in Qt's source code what to look for. There is no simple call in the API to do what you want directly.

Toniy
24th March 2016, 16:54
Does searching QUndoStack among children work for you? I tried but this did not work for me. Or is there any trick that I missed?