Create a subclass of QsciLexerCPP
and reimplement the keywords method:
class RSLLexer(Qsci.QsciLexerCPP):
def keywords(self, index):
keywords = Qsci.QsciLexerCPP.keywords(self, index) or ''
# primary keywords
if index == 1:
return 'foo ' + keywords
# secondary keywords
if index == 2:
return 'bar ' + keywords
# doc comment keywords
if index == 3:
return keywords
# global classes
if index == 4:
return keywords
return keywords
Each of these keyword sets has a different style associated with it, so they can be highlighted differently. See the style enumeration for which ones to use.