Search code examples
qtqt4stateqtextedit

Make setText of QTextEdit ^Z aware


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 ?


Solution

  • Instead of

    textEdit->setText("your text");
    

    do this:

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