How to append text to QPlainTextEdit without adding newline, and keep scroll at the bottom?

后端 未结 4 1301
时光取名叫无心
时光取名叫无心 2020-11-29 05:15

I need to append text to QPlainTextEdit without adding a newline to the text, but both methods appendPlainText() and appendHtml() adds

4条回答
  •  广开言路
    2020-11-29 05:52

    Like any string:

    QTextEdit *myTextEdit = ui->textEdit;
    myTextEdit->moveCursor (QTextCursor::End);
    myTextEdit->insertPlainText (myString+"\n");
    

    I tried it and it worked.

提交回复
热议问题