136 if (rangeStart != drawText.
length() && formatStack.
count()) {
139 formatRange.
start = rangeStart;
141 ranges.
append(formatRange);
143 rangeStart = drawText.
length();
148 if (formatStack.
count())
153 if (formatStack.
count())
154 format = formatStack.
top();
156 formatStack.
push(format);
174 if (rangeStart != drawText.
length() && formatStack.
count()) {
177 formatRange.
start = rangeStart;
179 ranges.
append(formatRange);
void setAdditionalFormats(const QList< FormatRange > &overrides)
Sets the additional formats supported by the text layout to formatList.
void setText(const QString &string)
Sets the layout's text to the given string.
The QTextLayout::FormatRange structure is used to apply extra formatting information for a specified ...
The QTextCharFormat class provides formatting information for characters in a QTextDocument.
bool isNull() const
Returns true if the character is the Unicode character 0x0000 ('\0'); otherwise returns false...
int count(const T &t) const
Returns the number of occurrences of value in the vector.
int length() const
Returns the number of characters in this string.
The QStack class is a template class that provides a stack.
int start
Specifies the beginning of the format range within the text layout's text.
The QString class provides a Unicode character string.
bool parseTag(const QChar *&ch, const QString &textIn, QString &textOut, QTextCharFormat &format)
The QChar class provides a 16-bit Unicode character.
bool parseCloseTag(const QChar *&ch, const QString &textIn)
T pop()
Removes the top item from the stack and returns it.
void reserve(int size)
Attempts to allocate memory for at least size characters.
void append(const T &t)
Inserts value at the end of the list.
void parseEntity(const QChar *&ch, const QString &textIn, QString &textOut)
void push(const T &t)
Adds element t to the top of the stack.
The QStringRef class provides a thin wrapper around QString substrings.
QString & append(QChar c)
int length
Specifies the numer of characters the format range spans.
QTextCharFormat format
Specifies the format to apply.
static const QChar lessThan
static const QChar ampersand
const QChar * constData() const
Returns a pointer to the data stored in the QString.
T & top()
Returns a reference to the stack's top item.