git-svn-id: svn://db.shs.com.ru/libs@84 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2016-04-14 16:16:09 +00:00
parent b4530da86b
commit f9b35564dc
254 changed files with 47 additions and 22091 deletions

View File

@@ -0,0 +1,31 @@
#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