[PyQt] Feature request: give QsyntaxHighlighter access to the global offset

Edward K. Ream edreamleo at gmail.com
Mon Feb 9 21:33:55 GMT 2009

On Mon, Feb 9, 2009 at 10:28 AM, Henning Schröder <post at henning-schroeder.de
> wrote:

> > The problem is that QSyntaxHighlighter.highlightBlock is passed only the
> string to be colored, *not* the offset of that string in the entire text.
> >
> Since Qt 4.4 there is QSyntaxHighligher.currentBlock()
> You should be able to use QTextBlock.postion() then to get the offset

Many, *many* thanks for this reply.  This eliminates the need for an
impossible-to-get-right method that I have been working on for days.  Now
everything "just works".

Edward K. Ream email: edreamleo at gmail.com
Leo: http://webpages.charter.net/edreamleo/front.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090209/892309f4/attachment.html

More information about the PyQt mailing list