#ifndef CONF_HIGHLIGHTER_H #define CONF_HIGHLIGHTER_H #include #include #include class QTextDocument; class ConfigHighlighter : public QSyntaxHighlighter { Q_OBJECT public: ConfigHighlighter(QTextDocument *parent = 0); QTextCursor cursor; private: void highlightBlock(const QString &text); struct HighlightingRule { QRegExp pattern; QTextCharFormat format; }; QVector highlightingRules; QRegExp commentStartExpression, commentEndExpression; QTextCharFormat singleLineCommentFormat, valueNameFormat, valueFormat, equalFormat, sectionFormat, spaceFormat, substFormat; }; #endif // CONF_HIGHTLIGHTER_H