jle_cpp_tk  0.0 2015-04-03 sh1:"d699093732dd5f321606d0ff7a6b63b229f1922c"
A small, safe, selft contained, soft-realtime C++ toolkit
highlighter.h
1 #ifndef __HIGHLIGHTER_H
2 #define __HIGHLIGHTER_H
3 
4 #include <QSyntaxHighlighter>
5 
6 
7 
8 class Highlighter : public QSyntaxHighlighter
9 {
10  Q_OBJECT
11 
12  public:
13  Highlighter(QTextDocument *parent = 0);
14 
15  protected:
16  void highlightBlock(const QString &text);
17 
18  private:
19  struct HighlightingRule
20  {
21  QRegExp pattern;
22  QTextCharFormat format;
23  };
24  QVector<HighlightingRule> highlightingRules;
25 
26  QTextCharFormat predefinedVars;
27  QTextCharFormat keywordFormat;
28  QTextCharFormat nonTerminalSymbol;
29  QTextCharFormat singleLineCommentFormat;
30  QTextCharFormat expandVar;
31  QTextCharFormat expandPredefVar;
32 };
33 
34 #endif // HIGHLIGHTER_H
Definition: highlighter.h:8