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

后端 未结 4 1291
时光取名叫无心
时光取名叫无心 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:34

    The current Answer was not an option for me. It was much simplier to add html with no new lines with the following method.

    //logs is a QPlainTextEdit object
    ui.logs->moveCursor(QTextCursor::End);
    ui.logs->textCursor().insertHtml(out);
    ui.logs->moveCursor(QTextCursor::End);
    

提交回复
热议问题