I use this code below to highlight the select text in text Browser.
the var selectLine have a text to highlight, but i want select all line width in editor with this text not just a selected text

Qt Code:
  1. void MyHighlighter::highlightBlock(const QString &text)
  2. {
  3. QTextCharFormat myClassFormat;
  4. QColor backColor = QColor("Red");
  5. myClassFormat.setBackground(backColor);
  6. myClassFormat.setProperty(QTextFormat::FullWidthSelection, true);
  7.  
  8. QString pattern = selectLine;
  9.  
  10. QRegExp expression(pattern);
  11. int index = text.indexOf(expression);
  12. while (index >= 0) {
  13. int length = expression.matchedLength();
  14. setFormat(index, length , myClassFormat);
  15. index = text.indexOf(expression, index + length);
  16. }
  17. }
  18. }
To copy to clipboard, switch view to plain text mode 

how can I do IT?