0

When I use QTextEdit::setText() , changes seems to be inrevokable , you can't get back with CTRL+Z , is there any other API I should use ?

daisy
  • 22,498
  • 29
  • 129
  • 265

2 Answers2

2

Instead of

textEdit->setText("your text");

do this:

textEdit->clear();
textEdit->append("your text");
0

To support undo/redo functionality properly in your application you may want to take a look at the Qt's Undo Framework documentation.

dschulz
  • 4,666
  • 1
  • 31
  • 31