[PyQt] Question about QsciLexerCustom
projetmbc
projetmbc at club-internet.fr
Fri Jun 12 22:55:28 BST 2009
Sorry but I do not see how to do. What is a minimal structure of the class ?
----------------------------------------
class myLexer(Qsci.QsciLexerCustom):
????
----------------------------------------
All kinds of clue is welcome.
Christophe.
Phil Thompson a écrit :
> On Wed, 10 Jun 2009 15:12:03 +0200, projetmbc <projetmbc at club-internet.fr>
> wrote:
>
>> Hello,
>> I would like to use QsciLexerCustom so as to define my own lexer. The
>> documentation says :
>> "All that is necessary to implement a new lexer is to
>> define appropriate
>> styles and to re-implement the styleText()
>> <classQsciLexerCustom.html#91d71c4bdff5140ae0b0cb34b4511f79> method."
>> This sounds very abstract to me. How can I color a single word like
>> STRANGE ? How can I define a block like a C++ comment ?
>>
>
> You have to parse the text you are being asked to style (or find it in a
> data structure you have already created) to determine what style should be
> applied to each character (or group of characters). Apply the style by
> making a call to startStyling() followed by one or more calls to
> setStyling().
>
> Phil
More information about the PyQt
mailing list