| 123456789101112131415161718192021222324252627282930313233 |
- #ifndef SYNTAXHIGHLIGHTER_H
- #define SYNTAXHIGHLIGHTER_H
- #include <QSyntaxHighlighter>
- class SyntaxHighlighter : public QSyntaxHighlighter
- {
- Q_OBJECT
- public:
- SyntaxHighlighter(QTextDocument *parent = 0);
- protected:
- void highlightBlock(const QString &text) Q_DECL_OVERRIDE;
- private:
- struct HighlightingRule
- {
- QRegExp pattern;
- QTextCharFormat format;
- };
- QVector<HighlightingRule> highlightingRules;
- QRegExp commentStartExpression;
- QRegExp commentEndExpression;
- QTextCharFormat keywordFormat;
- QTextCharFormat bankFormat;
- QTextCharFormat singleLineCommentFormat;
- QTextCharFormat multiLineCommentFormat;
- };
- #endif // SYNTAXHIGHLIGHTER_H
|