This repository has been archived on 2020-09-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
libs/piqt_tools/piqt_highlighter.h
Пелипенко Иван 17e8387d9d QPIConfig includes improvements
git-svn-id: svn://db.shs.com.ru/libs@77 a8b55f48-bf90-11e4-a774-851b48703e85
2016-01-28 08:25:58 +00:00

32 lines
692 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, substFormat;
};
#endif // CONF_HIGHTLIGHTER_H