문제

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.

도움이 되었습니까?

해결책

Got half way through writing this, supplemental to TonyK's answer:

Perhaps the append Method is what you're looking for?

Appends a new paragraph with text to the end of the text edit. The new paragraph appended will have the same character format and block format as the current paragraph, determined by the position of the cursor. See also currentCharFormat() and QTextCursor::blockFormat().

다른 팁

QTextBrowser inherits QTextEdit, so you can use QTextEdit::append:

void QTextEdit::append ( const QString & text )
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top