[QScintilla] Using QsciLexerCustom

Chris Packham judge.packham at gmail.com
Wed Jan 13 18:02:27 GMT 2010


Hi,

Is there an example somewhere using the QsciLexerCustom class? I want
to define my own lexer, don't want to hack around with the underlying
Scintilla code so this sounds like what I need.

Following the class reference [1] for QsciLexerCustom it appears that
I just need to implement styleText (which is actual incorrect because
I still need to implement language() and description() from
QsciLexer). I also wonder what a implementation of styleText looks
like. It appears that I need to start at the position "start" and do
something to classify the text calling setStyling with the appropriate
styles. How do I actually get at the text? Ideally I'd read from
"start" up to a terminating token (or "end") but I can't see an API in
the QsciScintilla class that will allow me to read x characters
starting at a position (i.e. byte offset).

Is there additional documentation on how to use QsciLexerCustom that I
should be reading?

Thanks,
Chris

---
[1] http://www.riverbankcomputing.co.uk/static/Docs/QScintilla2/classQsciLexerCustom.html


More information about the QScintilla mailing list