89 return d->pieceTable->formatCollection()->objectFormat(
d->objectIndex);
101 return d->pieceTable->formatCollection()->objectFormatIndex(
d->objectIndex);
113 int idx =
d->pieceTable->formatCollection()->indexForFormat(
format);
114 d->pieceTable->changeObjectFormat(
this, idx);
124 return d->objectIndex;
214 d->blocks.insert(
it, block);
215 d->markBlocksDirty();
226 d->blocks.removeAll(block);
227 d->markBlocksDirty();
228 if (
d->blocks.isEmpty()) {
387 delete d->layoutData;
406 return d->childFrames;
418 return d->parentFrame;
452 if (!
d->fragment_start)
454 return d->pieceTable->fragmentMap().position(
d->fragment_start) + 1;
465 if (!
d->fragment_end)
466 return d->pieceTable->length() - 1;
467 return d->pieceTable->fragmentMap().position(
d->fragment_end);
476 return d->layoutData;
485 delete d->layoutData;
486 d->layoutData =
data;
645 int end = cf->lastPosition() + 1;
653 if (!
f->d_func()->childFrames.isEmpty()) {
658 QTextFrame *nf = qobject_cast<QTextFrame *>(
priv->objectForFormat(frag->format));
683 int start = cf->firstPosition() - 1;
694 QTextFrame *pf = qobject_cast<QTextFrame *>(
priv->objectForFormat(frag->format));
815 return p !=
nullptr &&
p->blockMap().isValid(
n);
929 return p->blockMap().position(
n);
945 return p->blockMap().size(
n);
957 int pos =
p->blockMap().position(
n);
958 int len =
p->blockMap().size(
n);
1010 return p->formatCollection()->blockFormat(
p->blockMap().fragment(
n)->format);
1024 return p->blockMap().fragment(
n)->format;
1039 return p->formatCollection()->charFormat(charFormatIndex());
1053 return p->blockCharFormatIndex(
n);
1073 dir =
p->defaultTextOption.textDirection();
1087 uint ucs4 =
p->unicode();
1161 if (
format !=
it.value()->format) {
1162 if (cur -
start > 0) {
1175 if (cur -
start > 0) {
1192 return p ?
p->document() :
nullptr;
1206 return qobject_cast<QTextList *>(
obj);
1255 if (
data !=
b->userData)
1366 return p->blockMap().position(
n, 1);
1382 return p->blockMap().position(
n, 2);
1397 p->blockMap().setSize(
n,
count, 2);
1410 return p->blockMap().size(
n, 2);
1427 int b =
p->fragmentMap().findNode(
pos);
1428 int e =
p->fragmentMap().findNode(
pos+
len);
1445 int b =
p->fragmentMap().findNode(
pos);
1446 int e =
p->fragmentMap().findNode(
pos+
len);
1492 ne =
p->fragmentMap().next(ne);
1493 }
while (ne !=
e &&
p->fragmentMap().fragment(ne)->format ==
formatIndex);
1508 ne =
p->fragmentMap().next(ne);
1509 }
while (ne !=
e &&
p->fragmentMap().fragment(ne)->format ==
formatIndex);
1521 n =
p->fragmentMap().previous(
n);
1529 while (
n !=
b &&
p->fragmentMap().fragment(
n)->format !=
formatIndex) {
1531 n =
p->fragmentMap().previous(
n);
1639#if !defined(QT_NO_RAWFONT)
1645 int blockNode =
p->blockMap().findNode(
position());
1650 int blockPosition =
p->blockMap().
position(blockNode);
1659 for (
int i=0;
i<
layout->lineCount(); ++
i) {
1676 return p->fragmentMap().position(
n);
1692 len +=
p->fragmentMap().size(
f);
1693 f =
p->fragmentMap().next(
f);
1720 return p->formatCollection()->charFormat(
data->format);
1753 f =
p->fragmentMap().next(
f);
1760#include "moc_qtextobject.cpp"
static constexpr char32_t surrogateToUcs4(char16_t high, char16_t low) noexcept
Converts a UTF16 surrogate pair with the given high and low values to it's UCS-4-encoded code point.
@ ObjectReplacementCharacter
Direction direction() const noexcept
Returns the character's direction.
constexpr bool isLowSurrogate() const noexcept
Returns true if the QChar is the low part of a UTF16 surrogate (for example if its code point is in r...
constexpr bool isHighSurrogate() const noexcept
Returns true if the QChar is the high part of a UTF16 surrogate (for example if its code point is in ...
qsizetype size() const noexcept
void removeAt(qsizetype i)
iterator insert(qsizetype i, parameter_type t)
const_reference at(qsizetype i) const noexcept
QObject * parent() const
Returns a pointer to the parent object.
iterator find(const T &value)
\macro QT_RESTRICTED_CAST_FROM_ASCII
void reserve(qsizetype size)
Ensures the string has space for at least size characters.
QTextBlockUserData * userData
QTextBlockGroup(QTextDocument *doc)
Creates a new block group for the given document.
virtual void blockRemoved(const QTextBlock &block)
Removes the given block from the group; the block itself is not deleted, it simply isn't a member of ...
virtual void blockInserted(const QTextBlock &block)
Appends the given block to the end of the group.
QList< QTextBlock > blockList() const
Returns a (possibly empty) list of all the blocks that are part of the block group.
virtual void blockFormatChanged(const QTextBlock &block)
This function is called whenever the specified block of text is changed.
~QTextBlockGroup()
Destroys this block group; the blocks are not deleted, they simply don't belong to this block anymore...
virtual ~QTextBlockUserData()
Destroys the user data.
Q_GUI_EXPORT iterator & operator--()
The prefix – operator ({–i}) makes the preceding item current and returns an iterator pointing to the...
Q_GUI_EXPORT iterator & operator++()
The prefix ++ operator ({++i}) advances the iterator to the next item in the hash and returns an iter...
Q_GUI_EXPORT QTextFragment fragment() const
Returns the text fragment the iterator currently points to.
void setUserState(int state)
iterator begin() const
Returns a text block iterator pointing to the beginning of the text block.
int charFormatIndex() const
Returns an index into the document's internal list of character formats for the text block's characte...
QTextBlockUserData * userData() const
int length() const
Returns the length of the block in characters.
void setLineCount(int count)
QTextBlockFormat blockFormat() const
Returns the QTextBlockFormat that describes block-specific properties.
iterator end() const
Returns a text block iterator pointing to the end of the text block.
const QTextDocument * document() const
Returns the text document this text block belongs to, or \nullptr if the text block does not belong t...
bool isValid() const
Returns true if this text block is valid; otherwise returns false.
QList< QTextLayout::FormatRange > textFormats() const
bool contains(int position) const
Returns true if the given position is located within the text block; otherwise returns false.
void setRevision(int rev)
void setUserData(QTextBlockUserData *data)
QTextBlock next() const
Returns the text block in the document after this block, or an empty text block if this is the last o...
void setVisible(bool visible)
int firstLineNumber() const
QTextLayout * layout() const
Returns the QTextLayout that is used to lay out and display the block's contents.
int position() const
Returns the index of the block's first character within the document.
QString text() const
Returns the block's contents as plain text.
Qt::LayoutDirection textDirection() const
QTextCharFormat charFormat() const
Returns the QTextCharFormat that describes the block's character format.
QTextList * textList() const
If the block represents a list item, returns the list that the item belongs to; otherwise returns \nu...
int blockFormatIndex() const
Returns an index into the document's internal list of block formats for the text block's format.
QTextBlock previous() const
Returns the text block in the document before this block, or an empty text block if this is the first...
static QTextCursor fromPosition(QTextDocumentPrivate *d, int pos)
\reentrant \inmodule QtGui
void documentChange(int from, int length)
void deleteObject(QTextObject *object)
static const QTextDocumentPrivate * get(const QTextDocument *document)
FragmentMap::ConstIterator FragmentIterator
\reentrant \inmodule QtGui
QTextObject * objectForFormat(const QTextFormat &) const
Returns the text object associated with the format f.
QTextCharFormat charFormat(int index) const
QTextCharFormat toCharFormat() const
Returns this format as a character format.
QTextBlockFormat toBlockFormat() const
Returns this format as a block format.
bool contains(int position) const
Returns true if the text fragment contains the text at the given position in the document; otherwise ...
QList< QGlyphRun > glyphRuns(int from=-1, int length=-1) const
Returns the glyphs corresponding to len characters of this text fragment starting at position pos.
QString text() const
Returns the text fragment's as plain text.
QTextCharFormat charFormat() const
Returns the text fragment's character format.
int length() const
Returns the number of characters in the text fragment.
int position() const
Returns the position of this text fragment in the document.
int charFormatIndex() const
Returns an index into the document's internal list of character formats for the text fragment's chara...
virtual ~QTextFrameLayoutData()
virtual void fragmentRemoved(QChar type, uint fragment)
virtual void fragmentAdded(QChar type, uint fragment)
QList< QTextFrame * > childFrames
Q_GUI_EXPORT iterator & operator--()
Moves the iterator to the previous frame or block.
Q_GUI_EXPORT QTextBlock currentBlock() const
Returns the current block the iterator points to.
Q_GUI_EXPORT iterator & operator++()
Moves the iterator to the next frame or block.
void setLayoutData(QTextFrameLayoutData *data)
int lastPosition() const
Returns the last document position inside the frame.
QList< QTextFrame * > childFrames() const
Returns a (possibly empty) list of the frame's child frames.
iterator begin() const
Returns an iterator pointing to the first document element inside the frame.
QTextFrame * parentFrame() const
Returns the frame's parent frame.
QTextFrame(QTextDocument *doc)
Creates a new empty frame for the text document.
QTextCursor lastCursorPosition() const
Returns the last cursor position inside the frame.
int firstPosition() const
Returns the first document position inside the frame.
~QTextFrame()
Destroys the text frame.
iterator end() const
Returns an iterator pointing to the position past the last document element inside the frame.
QTextCursor firstCursorPosition() const
Returns the first cursor position inside the frame.
QTextFrameLayoutData * layoutData() const
QList< QGlyphRun > glyphRuns(int from=-1, int length=-1, QTextLayout::GlyphRunRetrievalFlags flags=QTextLayout::DefaultRetrievalFlags) const
Returns the glyph indexes and positions for all glyphs in this QTextLine for characters in the range ...
QTextDocumentPrivate * pieceTable
int objectIndex() const
Returns the object index of this object.
~QTextObject()
Destroys the text object.
void setFormat(const QTextFormat &format)
Sets the text object's format.
int formatIndex() const
Returns the index of the object's format in the document's internal list of formats.
QTextObject(QTextDocument *doc)
Creates a new QTextObject for the given document.
QTextFormat format() const
Returns the text object's format.
QTextDocument * document() const
Returns the document this object belongs to.
QMap< QString, QString > map
[6]
QSet< QString >::iterator it
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
GLdouble GLdouble GLdouble GLdouble q
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define QTextBeginningOfFrame
QVideoFrameFormat::PixelFormat fmt
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept