[QScintilla] Trying to set different color for different set of keywords in QsciLexerCPP

Jonas O. ezjonas at gmail.com
Mon Nov 8 21:20:39 GMT 2010


I subclassed QsciLexerCPP with the QsciLexerCO class, I added the
required other functions and other stuff.

Here is the enum:
enum
{
	BaseType = 20,
	Instruct = 21,
	Modifiers = 22,
	ClassRelated = 23,
	Oper = 24,
	Misc = 25
};

//Here is the keywords function:

const char *QsciLexerCO :: keywords(int set) const
{
	switch (set)
	{
		case BaseType:
			return
			"bool char double enum float int long "
			"short struct union void wchar_t";

		case ClassRelated:
			return
			"class inline friend private protected public "
			"template this virtual";

		case Misc:
			return
			"asm namespace typedef using";

		case Modifiers:
			"auto const explicit extern mutable register "
			"signed static unsigned volatile";

		case Instruct:
			return
			"break case continue default do else "
			"for goto if return switch while";
	}

	return 0;

}


On Mon, Nov 8, 2010 at 22:07, Phil Thompson <phil at riverbankcomputing.com> wrote:
> On Mon, 8 Nov 2010 21:47:06 +0100, "Jonas O." <ezjonas at gmail.com> wrote:
>> What is the relation between the set integer and the enum integers ?
>
> Sorry, I don't understand the question.
>
> Phil
>


More information about the QScintilla mailing list