title: How to highlight a string of text within a QTextEdit
body: <p>I'm a student programmer currently developing an application for work using Qt4. I am  building an equation editor and I'm having issues attempting to highlight a string within my <a href="http://doc.qt.digia.com/stable/qtextedit.html" rel="noreferrer">QTextEdit</a> field. I have a function that parses through the QTextEdit string and returns an a start and end integer of where an error is located. My original strategy was to use HTML tags at these two points to highlight the error. Unfortunately there appears to be an issue with html tagging and the equation syntax. </p>
  
  <p>What I think I need is a strategy that relies on Qt's library to set a background color between these two indices. I began looking a <a href="http://qt-project.org/doc/qt-4.8/qsyntaxhighlighter.html" rel="noreferrer">QSyntaxHighlighter</a>; however I think that this is more for highlighting using a predefined set of laws and not for just grabbing up anything between a &amp; b and setting the background color. If I can use syntax highlighter please provide me with and example or reference as I have already read through the documentation and didn't find anything. </p>
  
  <p>Thanks for any help in advance! </p>
  
  <p>P.S. Just to emphasize on the html compatibility issues; html becomes problematic due to multiple &lt; and > signs used. </p>