#ifndef HIGHLIGHTER_H #define HIGHLIGHTER_H #include #include // Downloaded from here: // https://github.com/isomoar/json-editor/blob/master/syntaxhighlightening/highlighter.cpp class Highlighter: public QSyntaxHighlighter { Q_OBJECT public: Highlighter(QTextDocument *parent = 0); protected: struct HighlightingRule { QRegExp pattern; QTextCharFormat format; }; QVector rules; protected: void highlightBlock(const QString &text); }; #endif // HIGHLIGHTER_H