Files
qad/piqt_tools/piqt_highlighter.h
Бычков Андрей ba8bc27298 1
git-svn-id: svn://db.shs.com.ru/libs@1 a8b55f48-bf90-11e4-a774-851b48703e85
2015-02-28 21:28:53 +00:00

32 lines
679 B
C++

#ifndef CONF_HIGHLIGHTER_H
#define CONF_HIGHLIGHTER_H
#include <QSyntaxHighlighter>
#include <QTextCursor>
#include <QTextCharFormat>
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<HighlightingRule> highlightingRules;
QRegExp commentStartExpression, commentEndExpression;
QTextCharFormat singleLineCommentFormat, valueNameFormat, valueFormat, equalFormat, sectionFormat, spaceFormat;
};
#endif // CONF_HIGHTLIGHTER_H