I have an application that has some sort of log viewer, that needs to be able to render formatted log records that are inserted to it in real time.
I am writing this in Qt and so far I was using QTextEdit
for rendering of the text, which was beautified using some html tags and later inserted either with setHtml
or insertHtml
.
The problem is however, that these functions are insanely CPU intensive and run for ages, hanging whole application.
A similar question was asked here: QTextEdit.insertHtml() is very slow
Apart it has no really useful answer, other than stating it's really slow, it actually asks a different thing. I don't need to speed up setHtml
or insertHtml
. I am willing to use entirely different technique if possible.
Is there any mechanism within Qt that would allow for really fast insertions of text? Or maybe even completely different component than QTextEdit
?
Is there any way to append new line to QTextEdit
which contains rich text (generated in any way) that is really fast?
I also noticed QTextBrowser
but it seems to be just an extension of TextEdit, could it be faster?