30 lines
625 B
C++
30 lines
625 B
C++
#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
|