I'm writing a program where I need to give any given string a color/highlight BEFORE adding it to the QTextBrowser. The string is stored in a variable so it doesn't seem to be possible to use HTML. Is there a way to do this?
Asked
Active
Viewed 547 times
0
-
2My first question would be, why are you using QTextBrowser and not just QTextEdit? Anyway, HTML is just a string anyway, but appending HTML won't necessarily work because it is outside of the tags. You might need to use insertHTML() and textCursor() methods of your QTextBrowser/QTextEdit to insert the HTML code in the right place. If you can clarify your question, it might be able to be answered. AT the moment I'm just guessing as to what your problem is. – three_pineapples Oct 16 '13 at 05:11
-
insertHTML() worked. Not as I expected, but it did . – UrbKr Oct 16 '13 at 14:46