Go to the documentation of this file.
2 #include <QXMLHighlighter>
3 #include <QSyntaxStyle>
8 m_xmlKeywordRegexes (),
9 m_xmlElementRegex (R
"(<[\s]*[/]?[\s]*([^\n][a-zA-Z-_:]*)(?=[\s/>]))"),
10 m_xmlAttributeRegex (R"(\w+(?=\=))"),
11 m_xmlValueRegex (R"("[^\n"]+"(?=\??[\s/>]))"),
12 m_xmlCommentBeginRegex(R"(<!--)"),
13 m_xmlCommentEndRegex (R"(-->)")
16 << QRegularExpression("<\\?")
17 << QRegularExpression(
"/>")
18 << QRegularExpression(
">")
19 << QRegularExpression(
"<")
20 << QRegularExpression(
"</")
21 << QRegularExpression(
"\\?>");
28 while (matchIterator.hasNext())
30 auto match = matchIterator.next();
33 match.capturedStart(),
34 match.capturedLength(),
56 setCurrentBlockState(0);
59 if (previousBlockState() != 1)
64 while (startIndex >= 0)
68 int endIndex =
match.capturedStart();
69 int commentLength = 0;
73 setCurrentBlockState(1);
74 commentLength =
text.length() - startIndex;
78 commentLength = endIndex - startIndex +
match.capturedLength();
99 auto matchIterator = regex.globalMatch(text);
101 while (matchIterator.hasNext())
103 auto match = matchIterator.next();
106 match.capturedStart(),
107 match.capturedLength(),
QRegularExpression m_xmlAttributeRegex
QSyntaxStyle * syntaxStyle() const
Method for getting syntax style.
void highlightBlock(const QString &text) override
void highlightByRegex(const QTextCharFormat &format, const QRegularExpression ®ex, const QString &text)
auto format(const text_style &ts, const S &format_str, const Args &... args) -> std::basic_string< Char >
QVector< QRegularExpression > m_xmlKeywordRegexes
QXMLHighlighter(QTextDocument *document=nullptr)
Constructor.
Class, that descrubes highlighter with syntax style.
QRegularExpression m_xmlCommentBeginRegex
static const char * match(MatchState *ms, const char *s, const char *p)
QRegularExpression m_xmlCommentEndRegex
QRegularExpression m_xmlValueRegex
QRegularExpression m_xmlElementRegex
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46