you can still use an own delegate, all what you need it's a create your own syntaxhiglighter then attach it to QTextDocument and then render text document using QTextDocument::drawContents in your delegate.