[QScintilla] Highlight behavior

Samuel Nascimento Pagliarini snpagliarini at gmail.com
Wed Jul 14 21:50:17 BST 2010


All keywords are white. And yes, I tried this:

lex->setColor(QColor("darkRed"), QsciLexerVerilog::Keyword);

and that:

lex->setDefaultColor(QColor("red"));

Is it really necessary do sub-class the lexer?

2010/7/14 Phil Thompson <phil at riverbankcomputing.com>:
> On Wed, 14 Jul 2010 14:27:38 -0300, Samuel Nascimento Pagliarini
> <snpagliarini at gmail.com> wrote:
>> Hey,
>>
>> I am trying to make a verilog editor but I cant quite get it to work
>> the way I want. I am able to change the colors of most tokens by using
>> these lines:
>>
>> ...
>>  lex->setColor(QColor("red"), QsciLexerVerilog::Default);
>>  lex->setColor(QColor("blue"), QsciLexerVerilog::Comment);
>>  lex->setColor(QColor("blue"), QsciLexerVerilog::CommentBang);
>>  lex->setColor(QColor("blue"), QsciLexerVerilog::CommentLine);
>>  lex->setColor(QColor("magenta"), QsciLexerVerilog::Number);
>> ...
>>
>> The problem is that some main keywords never get a color. I even tried
>> the following:
>>
>> lex->setColor(QColor("darkRed"), -1);
>>
>> still, keywords like "module", "begin", "end" are not colored. Any
> ideas?
>
> All keywords or just some of them?
>
> I assume you tried...
>
> lex->setColor(QColor("darkRed"), QsciLexerVerilog::Keyword);
>
> The other approach would be to sub-class QsciLexerVerilog and reimplement
> defaultColor().
>
> Phil
>


More information about the QScintilla mailing list