[QScintilla] Highlight behavior

Phil Thompson phil at riverbankcomputing.com
Wed Jul 14 20:21:07 BST 2010


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