/
githubmirror
/
x64dbg
Обзор
Документация
Войти
/
githubmirror
/
x64dbg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
development
src/cross/hex_viewer/PatternHighlighter.h
35 строк
906 B
Duncan Ogilvie
Fix formatting
17 авг 2025, 22:08
17 авг 2025, 22:08
b5f6df7
Код
Авторство
О чём код?
#pragma once #include <QObject> #include <QSyntaxHighlighter> #include <QTextCharFormat> #include <QRegularExpression> #include "CodeEditor.h" QT_BEGIN_NAMESPACE class QTextDocument; QT_END_NAMESPACE class PatternHighlighter : public QSyntaxHighlighter { Q_OBJECT public: PatternHighlighter(const CodeEditor* style, QTextDocument* parent = 0); void refreshColors(const CodeEditor* style); protected: void highlightBlock(const QString & text) override; private: struct HighlightingRule { QRegularExpression pattern; QTextCharFormat format; }; QVector<HighlightingRule> highlightingRules; QTextCharFormat multiLineCommentFormat; QRegularExpression commentStartExpression = QRegularExpression(QStringLiteral("/\\*")); QRegularExpression commentEndExpression = QRegularExpression(QStringLiteral("\\*/")); };