6#include <QtCore/qpoint.h>
7#include <QtGui/qabstracttextdocumentlayout.h>
8#include <QtGui/qrawfont.h>
9#include <QtGui/qtextdocument.h>
10#include <QtGui/qtextlayout.h>
11#include <QtGui/qtextobject.h>
12#include <QtGui/qtexttable.h>
13#include <QtGui/qtextlist.h>
15#include <private/qquicktext_p.h>
16#include <private/qquicktextdocument_p.h>
17#include <private/qtextdocumentlayout_p.h>
18#include <private/qtextimagehandler_p.h>
19#include <private/qrawfont_p.h>
20#include <private/qglyphrun_p.h>
21#include <private/qquickitem_p.h>
29 , clipNode(node->clipNode)
31 , selectionState(node->selectionState)
38 const Decorations &decs,
44 , selectionState(selState)
61 Decorations decorations,
const QColor &textColor,
89 int newIndex = binaryTree->
size();
90 binaryTree->
append(binaryTreeNode);
124 sortedIndexes->
append(currentIndex);
135 int textPos,
int fragmentEnd,
136 int selectionStart,
int selectionEnd)
143 while (textPos < fragmentEnd) {
144 int blockRelativePosition = textPos - block.
position();
154 int len =
qMin(lineEnd - textPos, fragmentEnd - textPos);
157 int currentStepEnd = textPos +
len;
165 textPos = currentStepEnd;
173 for (
int i=0;
i<textDecorations.
size(); ++
i) {
174 TextDecoration textDecoration = textDecorations.
at(
i);
179 rect.setHeight(thickness);
182 m_lines.
append(textDecoration);
186void QQuickTextNodeEngine::processCurrentLine()
189 if (m_currentLineTree.isEmpty())
201 Q_ASSERT(sortedIndexes.
size() == m_currentLineTree.size());
207 qreal underlineOffset = 0.0;
208 qreal underlineThickness = 0.0;
210 qreal overlineOffset = 0.0;
211 qreal overlineThickness = 0.0;
213 qreal strikeOutOffset = 0.0;
214 qreal strikeOutThickness = 0.0;
216 QRectF decorationRect = currentRect;
219 QColor lastBackgroundColor;
220 QColor lastDecorationColor;
225 if (!sortedIndexes.
isEmpty()) {
227 bool currentClipNodeUsed =
false;
228 for (
int i=0;
i<=sortedIndexes.
size(); ++
i) {
229 BinaryTreeNode *node =
nullptr;
230 if (
i < sortedIndexes.
size()) {
231 int sortedIndex = sortedIndexes.
at(
i);
232 Q_ASSERT(sortedIndex < m_currentLineTree.size());
234 node = m_currentLineTree.data() + sortedIndex;
236 currentSelectionState = node->selectionState;
241 decorationRect.
setY(m_position.
y() + m_currentLine.
y());
245 decorationRect.
setRight(node->boundingRect.left());
247 TextDecoration textDecoration(currentSelectionState, decorationRect, lastColor);
248 if (lastDecorationColor.
isValid() &&
252 textDecoration.color = lastDecorationColor;
255 pendingUnderlines.
append(textDecoration);
258 pendingOverlines.
append(textDecoration);
261 pendingStrikeOuts.
append(textDecoration);
270 if (node ==
nullptr || node->selectionState != currentSelectionState) {
271 currentRect.
setY(m_position.
y() + m_currentLine.
y());
274 if (currentSelectionState ==
Selected)
275 m_selectionRects.
append(currentRect);
277 if (currentClipNode !=
nullptr) {
278 if (!currentClipNodeUsed) {
279 delete currentClipNode;
282 currentClipNode->
setRect(currentRect);
283 currentClipNode->
update();
287 if (node !=
nullptr && m_hasSelection)
290 currentClipNode =
nullptr;
291 currentClipNodeUsed =
false;
293 if (node !=
nullptr) {
294 currentSelectionState = node->selectionState;
295 currentRect = node->boundingRect;
303 currentRect = node->boundingRect;
305 currentRect = currentRect.
united(node->boundingRect);
308 if (node !=
nullptr) {
309 if (node->selectionState ==
Selected) {
310 node->clipNode = currentClipNode;
311 currentClipNodeUsed =
true;
314 decorationRect = node->boundingRect;
318 if (!pendingUnderlines.
isEmpty()
320 addTextDecorations(pendingUnderlines, underlineOffset, underlineThickness);
322 pendingUnderlines.
clear();
324 underlineOffset = 0.0;
325 underlineThickness = 0.0;
330 if (!pendingOverlines.
isEmpty()) {
331 addTextDecorations(pendingOverlines, overlineOffset, overlineThickness);
333 pendingOverlines.
clear();
335 overlineOffset = 0.0;
336 overlineThickness = 0.0;
341 if (!pendingStrikeOuts.
isEmpty()) {
342 addTextDecorations(pendingStrikeOuts, strikeOutOffset, strikeOutThickness);
344 pendingStrikeOuts.
clear();
346 strikeOutOffset = 0.0;
347 strikeOutThickness = 0.0;
351 QRawFont rawFont = node->glyphRun.rawFont();
360 overlineOffset = -rawFont.
ascent();
366 strikeOutOffset = rawFont.
ascent() / -3.0;
369 currentDecorations = node->decorations;
370 lastColor = node->color;
371 lastBackgroundColor = node->backgroundColor;
372 lastDecorationColor = node->decorationColor;
373 m_processedNodes.append(*node);
377 if (!pendingUnderlines.
isEmpty())
378 addTextDecorations(pendingUnderlines, underlineOffset, underlineThickness);
380 if (!pendingOverlines.
isEmpty())
381 addTextDecorations(pendingOverlines, overlineOffset, overlineThickness);
383 if (!pendingStrikeOuts.
isEmpty())
384 addTextDecorations(pendingStrikeOuts, strikeOutOffset, strikeOutThickness);
387 m_currentLineTree.clear();
389 m_hasSelection =
false;
398 if (m_currentLineTree.isEmpty()) {
405 const BinaryTreeNode *lastNode = m_currentLineTree.data() + m_currentLineTree.size() - 1;
417 m_hasContents =
true;
426 if (handler !=
nullptr) {
433 image = imageDoc->image(imageFormat);
439 image = imageHandler->
image(textDocument, imageFormat);
443 if (
image.isNull()) {
457 switch (
format.verticalAlignment())
460 ascent =
line.ascent();
464 ascent = (
line.ascent() +
line.descent()) / 2 -
line.descent() +
size.height() / 2;
467 ascent =
size.height() -
line.descent();
471 ascent =
size.height();
492 int currentSize = m_currentLineTree.size();
501 m_hasSelection = m_hasSelection || m_currentLineTree.size() > currentSize;
506 int selectionStart,
int selectionEnd)
508 int currentPosition =
start;
510 for (
int j=0;
j<ranges.
size(); ++
j) {
512 if (
range.start +
range.length > currentPosition
513 &&
range.start < currentPosition + remainingLength) {
515 if (
range.start > currentPosition) {
519 int rangeEnd =
qMin(
range.start +
range.length, currentPosition + remainingLength);
522 rangeColor =
range.format.foreground().color();
523 else if (
range.format.isAnchor())
524 rangeColor = m_anchorColor;
526 ?
range.format.background().color()
530 ?
range.format.underlineColor()
534 rangeColor, rangeBackgroundColor, rangeDecorationColor,
535 selectionStart, selectionEnd);
538 remainingLength =
end - currentPosition;
540 }
else if (
range.start > currentPosition + remainingLength || remainingLength <= 0) {
545 if (remainingLength > 0) {
547 selectionStart, selectionEnd);
554 int selectionStart,
int selectionEnd)
557 if (
color.isValid()) {
558 oldColor = m_textColor;
562 QColor oldBackgroundColor = m_backgroundColor;
563 if (backgroundColor.
isValid()) {
564 oldBackgroundColor = m_backgroundColor;
565 m_backgroundColor = backgroundColor;
568 QColor oldDecorationColor = m_decorationColor;
569 if (decorationColor.
isValid()) {
570 oldDecorationColor = m_decorationColor;
571 m_decorationColor = decorationColor;
575 && selectionStart <= selectionEnd;
578 int rangeEnd = rangeStart + rangeLength;
579 if (!
hasSelection || (selectionStart > rangeEnd || selectionEnd < rangeStart)) {
581 for (
int j=0;
j<glyphRuns.
size(); ++
j) {
586 if (rangeStart < selectionStart) {
587 int length =
qMin(selectionStart - rangeStart, rangeLength);
589 for (
int j=0;
j<glyphRuns.
size(); ++
j) {
595 if (rangeEnd > selectionStart) {
596 int start =
qMax(selectionStart, rangeStart);
600 for (
int j=0;
j<glyphRuns.
size(); ++
j) {
606 if (selectionEnd >= rangeStart && selectionEnd < rangeEnd) {
607 int start = selectionEnd + 1;
608 int length = rangeEnd - selectionEnd - 1;
610 for (
int j=0;
j<glyphRuns.
size(); ++
j) {
618 m_decorationColor = oldDecorationColor;
621 m_backgroundColor = oldBackgroundColor;
624 m_textColor = oldColor;
629 const QBrush &borderBrush)
644 QTextDocumentLayout *documentLayout = qobject_cast<QTextDocumentLayout *>(document->documentLayout());
674 borderWidth, borderStyle, borderBrush);
675 if (
table !=
nullptr) {
676 int rows =
table->rows();
677 int columns =
table->columns();
685 borderStyle, borderBrush);
701 for (
int i = 0;
i < m_processedNodes.size(); ++
i) {
709 regularNodes->
append(node);
717 for (
int i = 0;
i < regularNodes->
size(); ++
i) {
725 for (
int j = 0;
j < nodes.
size(); ++
j)
726 count += nodes.
at(
j)->glyphRun.glyphIndexes().size();
738 for (
int j = 1;
j < nodes.
size(); ++
j) {
745 for (
int k = 0; k < otherPositions.
size(); ++k)
746 glyphPositions += otherPositions.
at(k) + (otherNode->
position - primaryNode->
position);
764 processCurrentLine();
770 for (
int i = 0;
i < m_backgrounds.
size(); ++
i) {
773 if (
color.alpha() != 0)
778 for (
int i = 0;
i < nodes.
size(); ++
i) {
783 for (
int i = 0;
i < imageNodes.
size(); ++
i) {
790 for (
int i = 0;
i < m_selectionRects.
size(); ++
i) {
792 if (m_selectionColor.
alpha() != 0)
797 for (
int i = 0;
i < m_lines.
size(); ++
i) {
798 const TextDecoration &textDecoration = m_lines.
at(
i);
801 ? m_selectedTextColor
802 : textDecoration.color;
808 for (
int i = 0;
i < nodes.
size(); ++
i) {
811 if (clipNode !=
nullptr && clipNode->
parent() ==
nullptr)
816 int previousNodeIndex =
i - 1;
817 int nextNodeIndex =
i + 1;
818 const BinaryTreeNode *previousNode = previousNodeIndex < 0 ? 0 : nodes.
at(previousNodeIndex);
820 previousNode = --previousNodeIndex < 0 ? 0 : nodes.
at(previousNodeIndex);
832 bool drawCurrent =
false;
833 if (previousNode !=
nullptr || nextNode !=
nullptr) {
837 int rangeLength =
range.second -
range.first + 1;
838 if (previousNode !=
nullptr) {
842 if (
range.first < otherRange.second &&
range.second > otherRange.first) {
846 if (rangeLength == 0)
852 if (nextNode !=
nullptr && rangeLength > 0) {
856 if (
range.first < otherRange.second &&
range.second > otherRange.first) {
860 if (rangeLength == 0)
866 if (rangeLength > 0) {
880 for (
int i = 0;
i < imageNodes.
size(); ++
i) {
896 if (textLayout ==
nullptr)
900 for (
int i=0;
i<additionalFormats.
size(); ++
i) {
906 if (!mergedFormats->
isEmpty()) {
913 if (additionalFormat.
start > lastFormat->
start) {
918 mergedRange = mergedFormats->
data() + mergedFormats->
size() - 1;
919 lastFormat = mergedFormats->
data() + mergedFormats->
size() - 2;
921 mergedRange = lastFormat;
939 if (additionalFormat.
length > 0)
940 mergedFormats->
append(additionalFormat);
967 mergeFormats(block.
layout(), &colorChanges);
974 qCDebug(lcSgText) <<
"adding block with length" << block.
length() <<
':' << blockBoundingRect <<
"in viewport" <<
viewport;
983 if (
layout->lineCount() > 0) {
999 switch (listFormat.
style()) {
1001 listItemBullet =
QChar(0x25E6);
1004 listItemBullet =
QChar(0x25AA);
1011 listItemBullet = textList->itemText(block);
1014 listItemBullet =
QChar(0x2022);
1020 listItemBullet =
QChar(0x2612);
1023 listItemBullet =
QChar(0x2610);
1032 xoff = -xoff -
size.width();
1037 layout.setText(listItemBullet);
1044 for (
int i=0;
i<glyphRuns.
size(); ++
i)
1052 while (!blockIterator.
atEnd()) {
1074 int blockRelativePosition = textPos - block.
position();
1082 (selectionStart < textPos +
text.
size()
1083 && selectionEnd >= textPos)
1098 int fragmentEnd = textPos + fragment.
length();
1100 if (preeditPosition >= 0
1101 && (preeditPosition + block.
position()) >= textPos
1102 && (preeditPosition + block.
position()) <= fragmentEnd) {
1103 fragmentEnd += preeditLength;
1109 additionalFormat.
length = fragmentEnd - textPos;
1110 additionalFormat.
format = charFormat;
1111 colorChanges << additionalFormat;
1114 textPos =
addText(block, charFormat, textColor, colorChanges, textPos, fragmentEnd,
1115 selectionStart, selectionEnd);
1122 if (preeditLength >= 0 && textPos <= block.
position() + preeditPosition) {
1124 textPos = block.
position() + preeditPosition;
1131 textPos, textPos + preeditLength,
1132 selectionStart, selectionEnd);
1139 QRectF ruleRect(0, 0, ruleLength.value(blockBoundingRect.
width()), 1);
1148 m_hasContents =
true;
virtual QRectF blockBoundingRect(const QTextBlock &block) const =0
Returns the bounding rectangle of block.
QTextObjectInterface * handlerForObject(int objectType) const
Returns a handler for objects of the given objectType.
const QColor & color() const
Returns the brush color.
Qt::BrushStyle style() const
Returns the brush style.
@ ObjectReplacementCharacter
The QColor class provides colors based on RGB, HSV or CMYK values.
int alpha() const noexcept
Returns the alpha color component of this color.
bool isValid() const noexcept
Returns true if the color is valid; otherwise returns false.
\reentrant \inmodule QtGui
static QGlyphRunPrivate * get(const QGlyphRun &glyphRun)
The QGlyphRun class provides direct access to the internal glyphs in a font.
bool overline() const
Returns true if this QGlyphRun should be painted with an overline decoration.
bool strikeOut() const
Returns true if this QGlyphRun should be painted with a strike out decoration.
void setPositions(const QList< QPointF > &positions)
Sets the positions of the edge of the baseline for each glyph in this set of glyph indexes to positio...
QList< quint32 > glyphIndexes() const
Returns the glyph indexes for this QGlyphRun object.
void setBoundingRect(const QRectF &boundingRect)
Sets the bounding rect of the glyphs in this QGlyphRun to be boundingRect.
QRawFont rawFont() const
Returns the font selected for this QGlyphRun object.
void setGlyphIndexes(const QList< quint32 > &glyphIndexes)
Set the glyph indexes for this QGlyphRun object to glyphIndexes.
bool isRightToLeft() const
Returns true if this QGlyphRun contains glyphs that are painted from the right to the left.
QRectF boundingRect() const
Returns the smallest rectangle that contains all glyphs in this QGlyphRun.
QList< QPointF > positions() const
Returns the position of the edge of the baseline for each glyph in this set of glyph indexes.
bool underline() const
Returns true if this QGlyphRun should be painted with an underline decoration.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
@ Format_ARGB32_Premultiplied
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
T value(const Key &key, const T &defaultValue=T()) const
The QPainter class performs low-level painting on widgets and other paint devices.
\inmodule QtCore\reentrant
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
void setRect(const QRectF &)
void addSelectedGlyphs(const QGlyphRun &glyphRun)
void addUnselectedGlyphs(const QGlyphRun &glyphRun)
void addTextObject(const QTextBlock &block, const QPointF &position, const QTextCharFormat &format, SelectionState selectionState, QTextDocument *textDocument, int pos, QTextFrameFormat::Position layoutPosition=QTextFrameFormat::InFlow)
void addToSceneGraph(QQuickTextNode *parent, QQuickText::TextStyle style=QQuickText::Normal, const QColor &styleColor=QColor())
void mergeProcessedNodes(QList< BinaryTreeNode * > *regularNodes, QList< BinaryTreeNode * > *imageNodes)
void addTextBlock(QTextDocument *, const QTextBlock &, const QPointF &position, const QColor &textColor, const QColor &anchorColor, int selectionStart, int selectionEnd, const QRectF &viewport=QRectF())
void addGlyphsInRange(int rangeStart, int rangeEnd, const QColor &color, const QColor &backgroundColor, const QColor &underlineColor, int selectionStart, int selectionEnd)
void setTextColor(const QColor &textColor)
QTextLine currentLine() const
void setCurrentLine(const QTextLine ¤tLine)
int addText(const QTextBlock &block, const QTextCharFormat &charFormat, const QColor &textColor, const QVarLengthArray< QTextLayout::FormatRange > &colorChanges, int textPos, int fragmentEnd, int selectionStart, int selectionEnd)
void addImage(const QRectF &rect, const QImage &image, qreal ascent, SelectionState selectionState, QTextFrameFormat::Position layoutPosition)
void addBorder(const QRectF &rect, qreal border, QTextFrameFormat::BorderStyle borderStyle, const QBrush &borderBrush)
void addFrameDecorations(QTextDocument *document, QTextFrame *frame)
void setCurrentTextDirection(Qt::LayoutDirection textDirection)
void addGlyphsForRanges(const QVarLengthArray< QTextLayout::FormatRange > &ranges, int start, int end, int selectionStart, int selectionEnd)
QSGGlyphNode * addGlyphs(const QPointF &position, const QGlyphRun &glyphs, const QColor &color, QQuickText::TextStyle style=QQuickText::Normal, const QColor &styleColor=QColor(), QSGNode *parentNode=0)
void addImage(const QRectF &rect, const QImage &image)
void addRectangleNode(const QRectF &rect, const QColor &color)
The QRawFont class provides access to a single physical instance of a font.
qreal ascent() const
Returns the ascent of this QRawFont in pixel units.
qreal underlinePosition() const
Returns the position from baseline for drawing underlines below the text rendered with this font.
qreal lineThickness() const
Returns the thickness for drawing lines (underline, overline, etc.) along with text drawn in this fon...
\inmodule QtCore\reentrant
constexpr void moveCenter(const QPointF &p) noexcept
Moves the rectangle, leaving the center point at the given position.
constexpr void setRight(qreal pos) noexcept
Sets the right edge of the rectangle to the given finite x coordinate.
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QRectF translated(qreal dx, qreal dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
constexpr void setY(qreal pos) noexcept
Sets the top edge of the rectangle to the given finite y coordinate.
constexpr void moveTopLeft(const QPointF &p) noexcept
Moves the rectangle, leaving the top-left corner at the given position.
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
bool intersects(const QRectF &r) const noexcept
Returns true if this rectangle intersects with the given rectangle (i.e.
constexpr void setSize(const QSizeF &s) noexcept
Sets the size of the rectangle to the given finite size.
constexpr bool isNull() const noexcept
Returns true if the rectangle is a null rectangle, otherwise returns false.
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QPointF center() const noexcept
Returns the center point of the rectangle.
constexpr void translate(qreal dx, qreal dy) noexcept
Moves the rectangle dx along the x-axis and dy along the y-axis, relative to the current position.
constexpr void setHeight(qreal h) noexcept
Sets the height of the rectangle to the given finite height.
constexpr QPointF topRight() const noexcept
Returns the position of the rectangle's top-right corner.
constexpr void moveTopRight(const QPointF &p) noexcept
Moves the rectangle, leaving the top-right corner at the given position.
QRectF united(const QRectF &other) const noexcept
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr int width() const noexcept
Returns the width of the rectangle.
void setIsRectangular(bool rectHint)
Sets whether this clip node has a rectangular clip to rectHint.
void appendChildNode(QSGNode *node)
Appends node to this node's list of children.
QSGNode * parent() const
Returns the parent node of this node.
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype size() const
Returns the number of characters in this string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
MarkerType marker() const
bool atEnd() const
Returns true if the current item is the last item in the text block.
Q_GUI_EXPORT QTextFragment fragment() const
Returns the text fragment the iterator currently points to.
iterator begin() const
Returns a text block iterator pointing to the beginning of the text block.
int length() const
Returns the length of the block in characters.
QTextBlockFormat blockFormat() const
Returns the QTextBlockFormat that describes block-specific properties.
bool isValid() const
Returns true if this text block is valid; otherwise returns false.
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.
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...
bool isAnchor() const
Returns true if the text is formatted as an anchor; otherwise returns false.
VerticalAlignment verticalAlignment() const
Returns the vertical alignment used for characters with this format.
QFont font() const
Returns the font for this character format.
QRectF tableCellBoundingRect(QTextTable *table, const QTextTableCell &cell) const
virtual QRectF frameBoundingRect(QTextFrame *frame) const override
Returns the bounding rectangle of frame.
QRectF tableBoundingRect(QTextTable *table) const
\reentrant \inmodule QtGui
QAbstractTextDocumentLayout * documentLayout() const
Returns the document layout for this document.
QTextObject * objectForFormat(const QTextFormat &) const
Returns the text object associated with the format f.
QBrush background() const
Returns the brush used to paint the document's background.
@ BlockTrailingHorizontalRulerWidth
QTextImageFormat toImageFormat() const
Returns this format as an image format.
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false.
void merge(const QTextFormat &other)
Merges the other format with this format; where there are conflicts the other format takes precedence...
QVariant property(int propertyId) const
Returns the property specified by the given propertyId.
QBrush foreground() const
Returns the brush used to render foreground details, such as text, frame outlines,...
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.
QBrush borderBrush() const
qreal border() const
Returns the width of the border in pixels.
BorderStyle borderStyle() const
qreal bottomMargin() const
Position
This enum describes how a frame is located relative to the surrounding text.
qreal rightMargin() const
QImage image(QTextDocument *doc, const QTextImageFormat &imageFormat)
QTextLine lineForTextPosition(int pos) const
Returns the line that contains the cursor position specified by pos.
QList< FormatRange > formats() const
int preeditAreaPosition() const
Returns the position of the area in the text layout that will be processed before editing occurs.
QString preeditAreaText() const
Returns the text that is inserted in the layout before editing occurs.
QRectF naturalTextRect() const
Returns the rectangle covered by the line.
QRectF rect() const
Returns the line's bounding rectangle.
qreal height() const
Returns the line's height.
qreal y() const
Returns the line's y position.
bool isValid() const
Returns true if this text line is valid; otherwise returns false.
qreal ascent() const
Returns the line's ascent.
QPointF position() const
Returns the line's position relative to the text layout's position.
Style style() const
Returns the list format's style.
The QTextObjectInterface class allows drawing of custom text objects in \l{QTextDocument}s.
virtual void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format)=0
Draws this text object using the specified painter.
virtual QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format)=0
The intrinsicSize() function returns the size of the text object represented by format in the given d...
constexpr size_type size() const noexcept
const T & at(qsizetype idx) const
QMap< QString, QString > map
[6]
cache insert(employee->id(), employee)
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
static QDBusError::ErrorType get(const char *name)
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
int qRound(qfloat16 d) noexcept
constexpr QtPrivate::QHashMultiReturnType< T... > qHashMulti(size_t seed, const T &... args) noexcept(std::conjunction_v< QtPrivate::QNothrowHashable< T >... >)
static bool hasSelection()
#define qCDebug(category,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
n void setPosition(void) \n\
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint border
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
GLenum GLenum GLsizei void * table
static const QRectF boundingRect(const QPointF *points, int pointCount)
constexpr decltype(auto) qMakePair(T1 &&value1, T2 &&value2) noexcept(noexcept(std::make_pair(std::forward< T1 >(value1), std::forward< T2 >(value2))))
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
view viewport() -> scroll(dx, dy, deviceRect)
\inmodule QtCore \reentrant
SelectionState selectionState
QList< QPair< int, int > > ranges
static void insert(QVarLengthArray< BinaryTreeNode, 16 > *binaryTree, const QRectF &rect, const QImage &image, qreal ascent, SelectionState selectionState)
QQuickDefaultClipNode * clipNode
static void inOrder(const QVarLengthArray< BinaryTreeNode, 16 > &binaryTree, QVarLengthArray< int > *sortedIndexes, int currentIndex=0)