Go to the documentation of this file.
2 #include <QJSONHighlighter>
3 #include <QSyntaxStyle>
9 m_keyRegex(R
"(("[^\r\n:]+?")\s*:)")
11 auto keywords = QStringList()
12 <<
"null" <<
"true" <<
"false";
14 for (
auto&& keyword : keywords)
17 QRegularExpression(QString(R
"(\b%1\b)").arg(keyword)),
24 QRegularExpression(R
"(\b(0b|0x){0,1}[\d.']+\b)"),
30 QRegularExpression(R
"("[^\n"]*")"),
39 auto matchIterator = rule.pattern.globalMatch(text);
41 while (matchIterator.hasNext())
43 auto match = matchIterator.next();
46 match.capturedStart(),
47 match.capturedLength(),
54 auto matchIterator =
m_keyRegex.globalMatch(text);
56 while (matchIterator.hasNext())
58 auto match = matchIterator.next();
61 match.capturedStart(1),
62 match.capturedLength(1),
QVector< QHighlightRule > m_highlightRules
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
QJSONHighlighter(QTextDocument *document=nullptr)
Constructor.
QSyntaxStyle * syntaxStyle() const
Method for getting syntax style.
Class, that descrubes highlighter with syntax style.
void highlightBlock(const QString &text) override
static const char * match(MatchState *ms, const char *s, const char *p)
QRegularExpression m_keyRegex
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45