Macke
Macke

Reputation: 25690

Making undo/redo work well with QTextDocument's and "replaceAll" operations

How do I make a single 'replaceAll' operation be a single step in QTextDocument's undo stack?

It does not use QUndoStack, it has it's own. :(

Upvotes: 1

Views: 134

Answers (1)

Macke
Macke

Reputation: 25690

Use beginEditBlock()/endEditBlock() to record all operations within as a single undo step, see the answer here https://stackoverflow.com/a/27113540/72312 for details.

Upvotes: 1

Related Questions