git-svn-id: svn://db.shs.com.ru/libs@84 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
31
piqt_utils/piqt_highlighter.h
Normal file
31
piqt_utils/piqt_highlighter.h
Normal 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
|
||||
Reference in New Issue
Block a user