XPlor/libs/core/highlighter_rumble.h

30 lines
625 B
C
Raw Normal View History

2025-06-04 22:10:14 -04:00
#ifndef HIGHLIGHTER_RUMBLE_H
#define HIGHLIGHTER_RUMBLE_H
#include <QSyntaxHighlighter>
#include <QRegularExpression>
class Highlighter_Rumble : public QSyntaxHighlighter
{
Q_OBJECT
public:
Highlighter_Rumble(QTextDocument *parent = nullptr);
protected:
void highlightBlock(const QString &text) override;
private:
struct HighlightingRule {
QRegularExpression pattern;
QTextCharFormat format;
};
QVector<HighlightingRule> highlightingRules;
QTextCharFormat headerFormat;
QTextCharFormat countFormat;
QTextCharFormat floatPairFormat;
};
#endif // HIGHLIGHTER_RUMBLE_H