5#include <QRegularExpression>
6#include <QSyntaxHighlighter>
7#include <QTextBlockUserData>
58while (startIndex >= 0) {
60 int endIndex =
text.
indexOf(endExpression, startIndex, &endMatch);
66 commentLength = endIndex - startIndex
69 setFormat(startIndex, commentLength, multiLineCommentFormat);
71 startIndex + commentLength);
\inmodule QtCore \reentrant
\inmodule QtCore \reentrant
qsizetype capturedLength(int nth=0) const
Returns the length of the substring captured by the nth capturing group.
\inmodule QtCore \reentrant
QRegularExpressionMatchIterator globalMatch(const QString &subject, qsizetype offset=0, MatchType matchType=NormalMatch, MatchOptions matchOptions=NoMatchOption) const
Attempts to perform a global match of the regular expression against the given subject string,...
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
qsizetype length() const
Returns the number of characters in this string.
\reentrant \inmodule QtGui
void setCurrentBlockState(int newState)
Sets the state of the current text block to newState.
int previousBlockState() const
Returns the end state of the text block previous to the syntax highlighter's current block.
QTextDocument * document() const
Returns the QTextDocument on which this syntax highlighter is installed.
void setFormat(int start, int count, const QTextCharFormat &format)
This function is applied to the syntax highlighter's current text block (i.e.
void setFontWeight(int weight)
Sets the text format's font weight to weight.
\reentrant \inmodule QtGui
The QTextEdit class provides a widget that is used to edit and display both plain and rich text.
QTextDocument * document
the underlying document of the text editor.
void setForeground(const QBrush &brush)
Sets the foreground brush to the specified brush.
MyHighlighter * highlighter
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
QList< ParenthesisInfo > parentheses
void highlightBlock(const QString &text)
[0]
MyHighlighter(QTextDocument *document)