Qt-interest Archive, July 2007
Optimizing QSyntaxHighlighter::rehighlight() to update the visible part of a document (not the all document)
Message 1 in thread
Hi everybody,
I'm working on a log analyzer program. This program displays a lot of text
lines in a QTextEdit widget and applies highlighting rules defined by the
user.
Each time the user changes his highlighting rules I call the
QSyntaxHighlighter::rehighlight() to redoes the highlighting on all the
document.
This works fine, for small document but when the document is quite large it
could take somes times. During the rehighlingting period, the application
appears as frozen.
To day, i would like to implement a more optimized method that only
rehighlight the visible part of the document, the part which is visible in
the current QTextEdit view.
Do you have any ideas for optimizing the rehighlight method ?
--
[ signature omitted ]