I have a QSyntaxHighlighter "installed" on a QTextEdit ( called textEdit).
on_textEdit_textChange() sets a "document dirty" flag whenever the user changes the contents of textEdit.
Works fine, BUT if I set the highlighter to highlight some text (in repsonse to user entered text in a lineEdit), it causes on_textEdit_textChange() to fire again thus setting my dirty flag although the text hasn't "really" changed.
I tried putting a flag up saying "don't set document dirty" before firing up the highlighter and resetting it afterwards. Unfortunately, I think the highlighting process runs asynchronously (QSyntaxHighlighter::rehighlight is a slot) so my "don't set document dirty" flag has come and gone well before the highlighting is actually done.
Any thoughts gratefully received!
Bookmarks