26#ifndef __SYNTAX_HIGHLIGHTER__
27#define __SYNTAX_HIGHLIGHTER__
32#include <QSyntaxHighlighter>
33#include <QRegularExpression>
34#include <QTextCharFormat>
76 void addRule(QString regexp, QColor color,
int weight = QFont::Normal,
bool italic =
false, QColor backgroundColor = Qt::transparent);
84 QMap<QString, QRegularExpression> rules;
87 QMap<QString, QTextCharFormat> formatters;
94 void highlightBlock(
const QString& text)
override;
98 void highlightPattern(
const QString& text,
const QString& pattern);
#define CAMITK_API
Definition CamiTKAPI.h:66
bool removeRule(QString regexp)
remove an existing rule (can be done on the fly)
Definition SyntaxHighlighter.cpp:54
void addRule(QString regexp, QColor color, int weight=QFont::Normal, bool italic=false, QColor backgroundColor=Qt::transparent)
add a new rule (can be done on the fly)
Definition SyntaxHighlighter.cpp:38
SyntaxHighlighter(QTextDocument *parent=nullptr)
constructor
Definition SyntaxHighlighter.cpp:31