QXRD  0.11.16
qxrdhighlighter.h
Go to the documentation of this file.
1 #ifndef QXRDHIGHLIGHTER_H
2 #define QXRDHIGHLIGHTER_H
3 
4 #include <QSyntaxHighlighter>
5 
6 #include <QHash>
7 #include <QTextCharFormat>
8 #include <QTextDocument>
9 
10 class QxrdHighlighter : public QSyntaxHighlighter
11 {
12  Q_OBJECT
13 
14 public:
15  QxrdHighlighter(QTextDocument *parent = 0);
16 
17 protected:
18  void highlightBlock(const QString &text);
19 
20 private:
22  {
23  QRegExp pattern;
24  QTextCharFormat format;
25  };
26  QVector<HighlightingRule> highlightingRules;
27 
30 
31  QTextCharFormat keywordFormat;
32  QTextCharFormat classFormat;
33  QTextCharFormat singleLineCommentFormat;
34  QTextCharFormat multiLineCommentFormat;
35  QTextCharFormat quotationFormat;
36  QTextCharFormat functionFormat;
37 };
38 
39 #endif
QRegExp commentStartExpression
QVector< HighlightingRule > highlightingRules
void highlightBlock(const QString &text)
QxrdHighlighter(QTextDocument *parent=0)
QTextCharFormat singleLineCommentFormat
QTextCharFormat multiLineCommentFormat
QRegExp commentEndExpression
QTextCharFormat keywordFormat
QTextCharFormat classFormat
QTextCharFormat quotationFormat
QTextCharFormat functionFormat