I have created a QTextBrowser
to display a large amount of data (actually displaying the run time log), which is dynamically generated in another processes.
I have found out that I can use fopen("log.html","a")
to append data to an actually log file, and reload()
it every time it's updated, but I think that's not efficient, or even possibly unwise.
I wonder if there's a neat way to implement this.
Re: How to add a new word to QTextEdit with "append" Like QTextExit::append() docs say, it appends a new paragraph. Use QTextEdit::moveCursor(QTextCursor::End) and QTextEdit::insertHtml() or QTextEdit::insertPlainText() instead. Dear JPN! for formatting the txtScrollEdit Text.
If you want to provide your users with an editable rich text editor, use QTextEdit. If you want a text browser without hypertext navigation use QTextEdit, and use QTextEdit::setReadOnly() to disable editing. If you just need to display a small piece of rich text use QLabel.
QTextBrowser
inherits QTextEdit
, so you can use QTextEdit::append
:
void QTextEdit::append ( const QString & text )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With