Maybe you could count the block number and look at the next line via QSyntaxHighlighter::document()