Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtextobject.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qtextobject.h"
5#include "qtextobject_p.h"
6#include "qtextcursor_p.h"
7#include "qtextdocument.h"
8#include "qtextformat_p.h"
9#include "qtextdocument_p.h"
10#include "qtextcursor.h"
11#include "qtextlist.h"
13#include "qtextengine_p.h"
14#include "qdebug.h"
15
16#include <algorithm>
17
19
20// ### DOC: We ought to explain the CONCEPT of objectIndexes if
21// relevant to the public API
60
70
80
87{
88 Q_D(const QTextObject);
89 return d->pieceTable->formatCollection()->objectFormat(d->objectIndex);
90}
91
99{
100 Q_D(const QTextObject);
101 return d->pieceTable->formatCollection()->objectFormatIndex(d->objectIndex);
102}
103
104
111{
112 Q_D(QTextObject);
113 int idx = d->pieceTable->formatCollection()->indexForFormat(format);
114 d->pieceTable->changeObjectFormat(this, idx);
115}
116
122{
123 Q_D(const QTextObject);
124 return d->objectIndex;
125}
126
133{
134 return static_cast<QTextDocument *>(parent());
135}
136
167{
168 for (int i = 0; i < blocks.size(); ++i) {
169 const QTextBlock &block = blocks.at(i);
170 pieceTable->documentChange(block.position(), block.length());
171 }
172}
173
186
194
202
203// ### DOC: Shouldn't this be insertBlock()?
211{
212 Q_D(QTextBlockGroup);
213 QTextBlockGroupPrivate::BlockList::Iterator it = std::lower_bound(d->blocks.begin(), d->blocks.end(), block);
214 d->blocks.insert(it, block);
215 d->markBlocksDirty();
216}
217
218// ### DOC: Shouldn't this be removeBlock()?
224{
225 Q_D(QTextBlockGroup);
226 d->blocks.removeAll(block);
227 d->markBlocksDirty();
228 if (d->blocks.isEmpty()) {
229 QTextDocumentPrivate::get(document())->deleteObject(this);
230 return;
231 }
232}
233
243
248QList<QTextBlock> QTextBlockGroup::blockList() const
249{
250 Q_D(const QTextBlockGroup);
251 return d->blocks;
252}
253
254
255
259
260
376
385{
386 Q_D(QTextFrame);
387 delete d->layoutData;
388}
389
397
403QList<QTextFrame *> QTextFrame::childFrames() const
404{
405 Q_D(const QTextFrame);
406 return d->childFrames;
407}
408
416{
417 Q_D(const QTextFrame);
418 return d->parentFrame;
419}
420
421
428{
429 Q_D(const QTextFrame);
430 return QTextCursorPrivate::fromPosition(d->pieceTable, firstPosition());
431}
432
439{
440 Q_D(const QTextFrame);
441 return QTextCursorPrivate::fromPosition(d->pieceTable, lastPosition());
442}
443
450{
451 Q_D(const QTextFrame);
452 if (!d->fragment_start)
453 return 0;
454 return d->pieceTable->fragmentMap().position(d->fragment_start) + 1;
455}
456
463{
464 Q_D(const QTextFrame);
465 if (!d->fragment_end)
466 return d->pieceTable->length() - 1;
467 return d->pieceTable->fragmentMap().position(d->fragment_end);
468}
469
474{
475 Q_D(const QTextFrame);
476 return d->layoutData;
477}
478
483{
484 Q_D(QTextFrame);
485 delete d->layoutData;
486 d->layoutData = data;
487}
488
489
490
492{
495 fragment_start = fragment;
496 } else if (type == QTextEndOfFrame) {
498 fragment_end = fragment;
499 } else if (type == QChar::ObjectReplacementCharacter) {
502 fragment_start = fragment;
503 fragment_end = fragment;
504 } else {
505 Q_ASSERT(false);
506 }
507}
508
510{
511 Q_UNUSED(fragment); // --release warning
513 Q_ASSERT(fragment_start == fragment);
514 fragment_start = 0;
515 } else if (type == QTextEndOfFrame) {
516 Q_ASSERT(fragment_end == fragment);
517 fragment_end = 0;
518 } else if (type == QChar::ObjectReplacementCharacter) {
519 Q_ASSERT(fragment_start == fragment);
520 Q_ASSERT(fragment_end == fragment);
521 fragment_start = 0;
522 fragment_end = 0;
523 } else {
524 Q_ASSERT(false);
525 }
526 remove_me();
527}
528
529
531{
532 Q_Q(QTextFrame);
533 if (fragment_start == 0 && fragment_end == 0
534 && !parentFrame) {
535 QTextDocumentPrivate::get(q->document())->deleteObject(q);
536 return;
537 }
538
539 if (!parentFrame)
540 return;
541
542 int index = parentFrame->d_func()->childFrames.indexOf(q);
543
544 // iterator over all children and move them to the parent
545 for (int i = 0; i < childFrames.size(); ++i) {
547 parentFrame->d_func()->childFrames.insert(index, c);
548 c->d_func()->parentFrame = parentFrame;
549 ++index;
550 }
551 Q_ASSERT(parentFrame->d_func()->childFrames.at(index) == q);
553
555 parentFrame = nullptr;
556}
557
588{
590 int b = priv->blockMap().findNode(firstPosition());
591 int e = priv->blockMap().findNode(lastPosition()+1);
592 return iterator(const_cast<QTextFrame *>(this), b, b, e);
593}
594
601{
603 int b = priv->blockMap().findNode(firstPosition());
604 int e = priv->blockMap().findNode(lastPosition()+1);
605 return iterator(const_cast<QTextFrame *>(this), e, b, e);
606}
607
629{
630 if (!f)
631 return QTextBlock();
633}
634
641{
643 const QTextDocumentPrivate::BlockMap &map = priv->blockMap();
644 if (cf) {
645 int end = cf->lastPosition() + 1;
646 cb = map.findNode(end);
647 cf = nullptr;
648 } else if (cb) {
649 cb = map.next(cb);
650 if (cb == e)
651 return *this;
652
653 if (!f->d_func()->childFrames.isEmpty()) {
654 int pos = map.position(cb);
655 // check if we entered a frame
657 if (priv->buffer().at(frag->stringPosition) != QChar::ParagraphSeparator) {
658 QTextFrame *nf = qobject_cast<QTextFrame *>(priv->objectForFormat(frag->format));
659 if (nf) {
660 if (priv->buffer().at(frag->stringPosition) == QTextBeginningOfFrame && nf != f) {
661 cf = nf;
662 cb = 0;
663 } else {
664 Q_ASSERT(priv->buffer().at(frag->stringPosition) != QTextEndOfFrame);
665 }
666 }
667 }
668 }
669 }
670 return *this;
671}
672
679{
681 const QTextDocumentPrivate::BlockMap &map = priv->blockMap();
682 if (cf) {
683 int start = cf->firstPosition() - 1;
684 cb = map.findNode(start);
685 cf = nullptr;
686 } else {
687 if (cb == b)
688 goto end;
689 if (cb != e) {
690 int pos = map.position(cb);
691 // check if we have to enter a frame
693 if (priv->buffer().at(frag->stringPosition) != QChar::ParagraphSeparator) {
694 QTextFrame *pf = qobject_cast<QTextFrame *>(priv->objectForFormat(frag->format));
695 if (pf) {
696 if (priv->buffer().at(frag->stringPosition) == QTextBeginningOfFrame) {
697 Q_ASSERT(pf == f);
698 } else if (priv->buffer().at(frag->stringPosition) == QTextEndOfFrame) {
699 Q_ASSERT(pf != f);
700 cf = pf;
701 cb = 0;
702 goto end;
703 }
704 }
705 }
706 }
707 cb = map.previous(cb);
708 }
709 end:
710 return *this;
711}
712
743
814{
815 return p != nullptr && p->blockMap().isValid(n);
816}
817
925{
926 if (!p || !n)
927 return 0;
928
929 return p->blockMap().position(n);
930}
931
941{
942 if (!p || !n)
943 return 0;
944
945 return p->blockMap().size(n);
946}
947
953{
954 if (!p || !n)
955 return false;
956
957 int pos = p->blockMap().position(n);
958 int len = p->blockMap().size(n);
959 return position >= pos && position < pos + len;
960}
961
973{
974 if (!p || !n)
975 return nullptr;
976
977 const QTextBlockData *b = p->blockMap().fragment(n);
978 if (!b->layout)
979 b->layout = new QTextLayout(*this);
980 return b->layout;
981}
982
991{
992 if (!p || !n)
993 return;
994
995 const QTextBlockData *b = p->blockMap().fragment(n);
996 if (b->layout)
997 b->layout->clearLayout();
998}
999
1006{
1007 if (!p || !n)
1008 return QTextFormat().toBlockFormat();
1009
1010 return p->formatCollection()->blockFormat(p->blockMap().fragment(n)->format);
1011}
1012
1020{
1021 if (!p || !n)
1022 return -1;
1023
1024 return p->blockMap().fragment(n)->format;
1025}
1026
1035{
1036 if (!p || !n)
1037 return QTextFormat().toCharFormat();
1038
1039 return p->formatCollection()->charFormat(charFormatIndex());
1040}
1041
1049{
1050 if (!p || !n)
1051 return -1;
1052
1053 return p->blockCharFormatIndex(n);
1054}
1055
1068{
1069 Qt::LayoutDirection dir = blockFormat().layoutDirection();
1071 return dir;
1072
1073 dir = p->defaultTextOption.textDirection();
1075 return dir;
1076
1077 const QString buffer = p->buffer();
1078
1079 const int pos = position();
1081 QTextDocumentPrivate::FragmentIterator end = p->find(pos + length() - 1); // -1 to omit the block separator char
1082 for (; it != end; ++it) {
1083 const QTextFragmentData * const frag = it.value();
1084 const QChar *p = buffer.constData() + frag->stringPosition;
1085 const QChar * const end = p + frag->size_array[0];
1086 while (p < end) {
1087 uint ucs4 = p->unicode();
1088 if (QChar::isHighSurrogate(ucs4) && p + 1 < end) {
1089 ushort low = p[1].unicode();
1090 if (QChar::isLowSurrogate(low)) {
1091 ucs4 = QChar::surrogateToUcs4(ucs4, low);
1092 ++p;
1093 }
1094 }
1095 switch (QChar::direction(ucs4)) {
1096 case QChar::DirL:
1097 return Qt::LeftToRight;
1098 case QChar::DirR:
1099 case QChar::DirAL:
1100 return Qt::RightToLeft;
1101 default:
1102 break;
1103 }
1104 ++p;
1105 }
1106 }
1107 return Qt::LeftToRight;
1108}
1109
1116{
1117 if (!p || !n)
1118 return QString();
1119
1120 const QString buffer = p->buffer();
1121 QString text;
1122 text.reserve(length());
1123
1124 const int pos = position();
1126 QTextDocumentPrivate::FragmentIterator end = p->find(pos + length() - 1); // -1 to omit the block separator char
1127 for (; it != end; ++it) {
1128 const QTextFragmentData * const frag = it.value();
1129 text += QStringView(buffer.constData() + frag->stringPosition, frag->size_array[0]);
1130 }
1131
1132 return text;
1133}
1134
1144QList<QTextLayout::FormatRange> QTextBlock::textFormats() const
1145{
1146 QList<QTextLayout::FormatRange> formats;
1147 if (!p || !n)
1148 return formats;
1149
1150 const QTextFormatCollection *formatCollection = p->formatCollection();
1151
1152 int start = 0;
1153 int cur = start;
1154 int format = -1;
1155
1156 const int pos = position();
1158 QTextDocumentPrivate::FragmentIterator end = p->find(pos + length() - 1); // -1 to omit the block separator char
1159 for (; it != end; ++it) {
1160 const QTextFragmentData * const frag = it.value();
1161 if (format != it.value()->format) {
1162 if (cur - start > 0) {
1164 range.start = start;
1165 range.length = cur - start;
1166 range.format = formatCollection->charFormat(format);
1167 formats.append(range);
1168 }
1169
1170 format = frag->format;
1171 start = cur;
1172 }
1173 cur += frag->size_array[0];
1174 }
1175 if (cur - start > 0) {
1177 range.start = start;
1178 range.length = cur - start;
1179 range.format = formatCollection->charFormat(format);
1180 formats.append(range);
1181 }
1182
1183 return formats;
1184}
1185
1191{
1192 return p ? p->document() : nullptr;
1193}
1194
1200{
1201 if (!isValid())
1202 return nullptr;
1203
1204 const QTextBlockFormat fmt = blockFormat();
1206 return qobject_cast<QTextList *>(obj);
1207}
1208
1216{
1217 if (!p || !n)
1218 return nullptr;
1219
1220 const QTextBlockData *b = p->blockMap().fragment(n);
1221 return b->userData;
1222}
1223
1250{
1251 if (!p || !n)
1252 return;
1253
1254 const QTextBlockData *b = p->blockMap().fragment(n);
1255 if (data != b->userData)
1256 delete b->userData;
1257 b->userData = data;
1258}
1259
1266{
1267 if (!p || !n)
1268 return -1;
1269
1270 const QTextBlockData *b = p->blockMap().fragment(n);
1271 return b->userState;
1272}
1273
1281{
1282 if (!p || !n)
1283 return;
1284
1285 const QTextBlockData *b = p->blockMap().fragment(n);
1286 b->userState = state;
1287}
1288
1297{
1298 if (!p || !n)
1299 return -1;
1300
1301 const QTextBlockData *b = p->blockMap().fragment(n);
1302 return b->revision;
1303}
1304
1313{
1314 if (!p || !n)
1315 return;
1316
1317 const QTextBlockData *b = p->blockMap().fragment(n);
1318 b->revision = rev;
1319}
1320
1329{
1330 if (!p || !n)
1331 return true;
1332
1333 const QTextBlockData *b = p->blockMap().fragment(n);
1334 return !b->hidden;
1335}
1336
1344void QTextBlock::setVisible(bool visible)
1345{
1346 if (!p || !n)
1347 return;
1348
1349 const QTextBlockData *b = p->blockMap().fragment(n);
1350 b->hidden = !visible;
1351}
1352
1353
1363{
1364 if (!p || !n)
1365 return -1;
1366 return p->blockMap().position(n, 1);
1367}
1368
1379{
1380 if (!p || !n)
1381 return -1;
1382 return p->blockMap().position(n, 2);
1383}
1384
1385
1394{
1395 if (!p || !n)
1396 return;
1397 p->blockMap().setSize(n, count, 2);
1398}
1407{
1408 if (!p || !n)
1409 return -1;
1410 return p->blockMap().size(n, 2);
1411}
1412
1413
1421{
1422 if (!p || !n)
1423 return iterator();
1424
1425 int pos = position();
1426 int len = length() - 1; // exclude the fragment that holds the paragraph separator
1427 int b = p->fragmentMap().findNode(pos);
1428 int e = p->fragmentMap().findNode(pos+len);
1429 return iterator(p, b, e, b);
1430}
1431
1439{
1440 if (!p || !n)
1441 return iterator();
1442
1443 int pos = position();
1444 int len = length() - 1; // exclude the fragment that holds the paragraph separator
1445 int b = p->fragmentMap().findNode(pos);
1446 int e = p->fragmentMap().findNode(pos+len);
1447 return iterator(p, b, e, e);
1448}
1449
1450
1460{
1461 if (!isValid())
1462 return QTextBlock();
1463
1464 return QTextBlock(p, p->blockMap().next(n));
1465}
1466
1476{
1477 if (!p)
1478 return QTextBlock();
1479
1480 return QTextBlock(p, p->blockMap().previous(n));
1481}
1482
1483
1488{
1489 int ne = n;
1490 int formatIndex = p->fragmentMap().fragment(n)->format;
1491 do {
1492 ne = p->fragmentMap().next(ne);
1493 } while (ne != e && p->fragmentMap().fragment(ne)->format == formatIndex);
1494 return QTextFragment(p, n, ne);
1495}
1496
1504{
1505 int ne = n;
1506 int formatIndex = p->fragmentMap().fragment(n)->format;
1507 do {
1508 ne = p->fragmentMap().next(ne);
1509 } while (ne != e && p->fragmentMap().fragment(ne)->format == formatIndex);
1510 n = ne;
1511 return *this;
1512}
1513
1520{
1521 n = p->fragmentMap().previous(n);
1522
1523 if (n == b)
1524 return *this;
1525
1526 int formatIndex = p->fragmentMap().fragment(n)->format;
1527 int last = n;
1528
1529 while (n != b && p->fragmentMap().fragment(n)->format != formatIndex) {
1530 last = n;
1531 n = p->fragmentMap().previous(n);
1532 }
1533
1534 n = last;
1535 return *this;
1536}
1537
1538
1639#if !defined(QT_NO_RAWFONT)
1640QList<QGlyphRun> QTextFragment::glyphRuns(int pos, int len) const
1641{
1642 if (!p || !n)
1643 return QList<QGlyphRun>();
1644
1645 int blockNode = p->blockMap().findNode(position());
1646
1647 const QTextBlockData *blockData = p->blockMap().fragment(blockNode);
1648 QTextLayout *layout = blockData->layout;
1649
1650 int blockPosition = p->blockMap().position(blockNode);
1651 if (pos < 0)
1652 pos = position() - blockPosition;
1653 if (len < 0)
1654 len = length();
1655 if (len == 0)
1656 return QList<QGlyphRun>();
1657
1658 QList<QGlyphRun> ret;
1659 for (int i=0; i<layout->lineCount(); ++i) {
1660 QTextLine textLine = layout->lineAt(i);
1661 ret += textLine.glyphRuns(pos, len);
1662 }
1663
1664 return ret;
1665}
1666#endif // QT_NO_RAWFONT
1667
1672{
1673 if (!p || !n)
1674 return 0; // ### -1 instead?
1675
1676 return p->fragmentMap().position(n);
1677}
1678
1685{
1686 if (!p || !n)
1687 return 0;
1688
1689 int len = 0;
1690 int f = n;
1691 while (f != ne) {
1692 len += p->fragmentMap().size(f);
1693 f = p->fragmentMap().next(f);
1694 }
1695 return len;
1696}
1697
1703{
1704 if (!p || !n)
1705 return false;
1706 int pos = this->position();
1707 return position >= pos && position < pos + length();
1708}
1709
1716{
1717 if (!p || !n)
1718 return QTextCharFormat();
1719 const QTextFragmentData *data = p->fragmentMap().fragment(n);
1720 return p->formatCollection()->charFormat(data->format);
1721}
1722
1730{
1731 if (!p || !n)
1732 return -1;
1733 const QTextFragmentData *data = p->fragmentMap().fragment(n);
1734 return data->format;
1735}
1736
1743{
1744 if (!p || !n)
1745 return QString();
1746
1748 QString buffer = p->buffer();
1749 int f = n;
1750 while (f != ne) {
1751 const QTextFragmentData * const frag = p->fragmentMap().fragment(f);
1752 result += QString(buffer.constData() + frag->stringPosition, frag->size_array[0]);
1753 f = p->fragmentMap().next(f);
1754 }
1755 return result;
1756}
1757
1759
1760#include "moc_qtextobject.cpp"
\inmodule QtCore
QLayout * layout() override
\reimp
qsizetype size() const noexcept
Definition qlist.h:397
void removeAt(qsizetype i)
Definition qlist.h:590
iterator Iterator
Definition qlist.h:249
iterator insert(qsizetype i, parameter_type t)
Definition qlist.h:488
const_reference at(qsizetype i) const noexcept
Definition qlist.h:446
void clear()
Definition qlist.h:434
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
iterator find(const T &value)
Definition qset.h:159
\inmodule QtCore
Definition qstringview.h:78
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void reserve(qsizetype size)
Ensures the string has space for at least size characters.
Definition qstring.h:1325
QTextBlockUserData * userData
QTextLayout * layout
signed int revision
\reentrant
Definition qtextobject.h:53
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.
\reentrant
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.
int lineCount() const
void setLineCount(int count)
QTextBlockFormat blockFormat() const
Returns the QTextBlockFormat that describes block-specific properties.
int blockNumber() const
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.
int revision() const
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 userState() const
bool isVisible() const
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...
void clearLayout()
static QTextCursor fromPosition(QTextDocumentPrivate *d, int pos)
\reentrant \inmodule QtGui
Definition qtextcursor.h:30
void documentChange(int from, int length)
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
\reentrant
Definition qtextformat.h:90
QTextCharFormat toCharFormat() const
Returns this format as a character format.
QTextBlockFormat toBlockFormat() const
Returns this format as a block format.
\reentrant
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)
QTextFrame * parentFrame
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.
\reentrant
Definition qtextobject.h:81
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.
friend class iterator
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
\reentrant
Definition qtextlayout.h:70
void clearLayout()
\reentrant
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 ...
\reentrant
Definition qtextlist.h:18
QTextDocumentPrivate * pieceTable
\reentrant
Definition qtextobject.h:25
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]
QString text
QSet< QString >::iterator it
else opt state
[0]
EGLint EGLint * formats
Combined button and popup list for selecting options.
LayoutDirection
@ LeftToRight
@ LayoutDirectionAuto
@ RightToLeft
return ret
static const QMetaObjectPrivate * priv(const uint *data)
GLboolean GLboolean GLboolean b
GLuint index
[2]
GLuint GLuint end
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat f
GLsizei range
GLenum GLuint buffer
GLenum type
GLuint start
GLfloat n
GLint GLsizei GLsizei GLenum format
GLhandleARB obj
[2]
const GLubyte * c
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLuint64EXT * result
[6]
GLfloat GLfloat p
[1]
GLenum GLsizei len
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define QTextBeginningOfFrame
#define QTextEndOfFrame
#define Q_UNUSED(x)
unsigned int uint
Definition qtypes.h:34
unsigned short ushort
Definition qtypes.h:33
QVideoFrameFormat::PixelFormat fmt
QVBoxLayout * layout
QString dir
[11]
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
Definition qlist.h:962