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
QQuickTextNodeEngine Class Reference

#include <qquicktextnodeengine_p.h>

+ Collaboration diagram for QQuickTextNodeEngine:

Classes

struct  BinaryTreeNode
 
struct  BinaryTreeNodeKey
 

Public Types

enum  Decoration {
  NoDecoration = 0x0 , Underline = 0x1 , Overline = 0x2 , StrikeOut = 0x4 ,
  Background = 0x8
}
 
enum  SelectionState { Unselected , Selected }
 

Public Member Functions

 QQuickTextNodeEngine ()
 
bool hasContents () const
 
void addTextBlock (QTextDocument *, const QTextBlock &, const QPointF &position, const QColor &textColor, const QColor &anchorColor, int selectionStart, int selectionEnd, const QRectF &viewport=QRectF())
 
QTextLine currentLine () const
 
void setCurrentLine (const QTextLine &currentLine)
 
void setCurrentTextDirection (Qt::LayoutDirection textDirection)
 
void addBorder (const QRectF &rect, qreal border, QTextFrameFormat::BorderStyle borderStyle, const QBrush &borderBrush)
 
void addFrameDecorations (QTextDocument *document, QTextFrame *frame)
 
void addImage (const QRectF &rect, const QImage &image, qreal ascent, SelectionState selectionState, QTextFrameFormat::Position layoutPosition)
 
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 addTextObject (const QTextBlock &block, const QPointF &position, const QTextCharFormat &format, SelectionState selectionState, QTextDocument *textDocument, int pos, QTextFrameFormat::Position layoutPosition=QTextFrameFormat::InFlow)
 
void addSelectedGlyphs (const QGlyphRun &glyphRun)
 
void addUnselectedGlyphs (const QGlyphRun &glyphRun)
 
void addGlyphsInRange (int rangeStart, int rangeEnd, const QColor &color, const QColor &backgroundColor, const QColor &underlineColor, int selectionStart, int selectionEnd)
 
void addGlyphsForRanges (const QVarLengthArray< QTextLayout::FormatRange > &ranges, int start, int end, int selectionStart, int selectionEnd)
 
void mergeProcessedNodes (QList< BinaryTreeNode * > *regularNodes, QList< BinaryTreeNode * > *imageNodes)
 
void addToSceneGraph (QSGInternalTextNode *parent, QQuickText::TextStyle style=QQuickText::Normal, const QColor &styleColor=QColor())
 
void setSelectionColor (const QColor &selectionColor)
 
void setSelectedTextColor (const QColor &selectedTextColor)
 
void setTextColor (const QColor &textColor)
 
void setAnchorColor (const QColor &anchorColor)
 
void setPosition (const QPointF &position)
 

Friends

class QSGInternalTextNode
 

Detailed Description

Definition at line 34 of file qquicktextnodeengine_p.h.

Member Enumeration Documentation

◆ Decoration

Enumerator
NoDecoration 
Underline 
Overline 
StrikeOut 
Background 

Definition at line 36 of file qquicktextnodeengine_p.h.

◆ SelectionState

Enumerator
Unselected 
Selected 

Definition at line 45 of file qquicktextnodeengine_p.h.

Constructor & Destructor Documentation

◆ QQuickTextNodeEngine()

QQuickTextNodeEngine::QQuickTextNodeEngine ( )
inline

Definition at line 112 of file qquicktextnodeengine_p.h.

Member Function Documentation

◆ addBorder()

void QQuickTextNodeEngine::addBorder ( const QRectF & rect,
qreal border,
QTextFrameFormat::BorderStyle borderStyle,
const QBrush & borderBrush )

Definition at line 619 of file qquicktextnodeengine.cpp.

References QList< T >::append(), QBrush::color(), Q_UNUSED, qMakePair(), and rect.

Referenced by addFrameDecorations().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addFrameDecorations()

◆ addGlyphsForRanges()

void QQuickTextNodeEngine::addGlyphsForRanges ( const QVarLengthArray< QTextLayout::FormatRange > & ranges,
int start,
int end,
int selectionStart,
int selectionEnd )

Definition at line 496 of file qquicktextnodeengine.cpp.

References addGlyphsInRange(), QTextFormat::BackgroundBrush, QTextFormat::ForegroundBrush, j, qMin(), and QTextFormat::TextUnderlineColor.

Referenced by addText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlyphsInRange()

void QQuickTextNodeEngine::addGlyphsInRange ( int rangeStart,
int rangeEnd,
const QColor & color,
const QColor & backgroundColor,
const QColor & underlineColor,
int selectionStart,
int selectionEnd )

Definition at line 544 of file qquicktextnodeengine.cpp.

References addSelectedGlyphs(), addUnselectedGlyphs(), hasSelection(), QColor::isValid(), j, line, qMax(), and qMin().

Referenced by addGlyphsForRanges().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addImage()

void QQuickTextNodeEngine::addImage ( const QRectF & rect,
const QImage & image,
qreal ascent,
SelectionState selectionState,
QTextFrameFormat::Position layoutPosition )

Definition at line 391 of file qquicktextnodeengine.cpp.

References QTextLine::ascent(), QTextFrameFormat::InFlow, QQuickTextNodeEngine::BinaryTreeNode::insert(), QTextLine::position(), QTextLine::rect(), rect, Qt::RightToLeft, and QRectF::topRight().

Referenced by addTextObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSelectedGlyphs()

void QQuickTextNodeEngine::addSelectedGlyphs ( const QGlyphRun & glyphRun)

Definition at line 482 of file qquicktextnodeengine.cpp.

References QQuickTextNodeEngine::BinaryTreeNode::insert(), NoDecoration, and Selected.

Referenced by addGlyphsInRange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addText()

int QQuickTextNodeEngine::addText ( const QTextBlock & block,
const QTextCharFormat & charFormat,
const QColor & textColor,
const QVarLengthArray< QTextLayout::FormatRange > & colorChanges,
int textPos,
int fragmentEnd,
int selectionStart,
int selectionEnd )

Definition at line 130 of file qquicktextnodeengine.cpp.

References addGlyphsForRanges(), QBrush::color(), currentLine(), QTextFormat::foreground(), QTextBlock::layout(), line, QTextLayout::lineForTextPosition(), Qt::NoBrush, QTextBlock::position(), Q_ASSERT, qMin(), setCurrentLine(), setTextColor(), and QBrush::style().

Referenced by addTextBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTextBlock()

void QQuickTextNodeEngine::addTextBlock ( QTextDocument * textDocument,
const QTextBlock & block,
const QPointF & position,
const QColor & textColor,
const QColor & anchorColor,
int selectionStart,
int selectionEnd,
const QRectF & viewport = QRectF() )

Adds the block from the textDocument at position if its \l {QAbstractTextDocumentLayout::blockBoundingRect()}{bounding rect} intersects the viewport, or if viewport is not valid (i.e. use a default-constructed QRectF to skip the viewport check).

See also
QQuickItem::clipRect()

Definition at line 954 of file qquicktextnodeengine.cpp.

References addText(), addTextObject(), addUnselectedGlyphs(), QTextCharFormat::AlignSubScript, QTextCharFormat::AlignSuperScript, QList< T >::append(), QTextFormat::background(), QTextFormat::BackgroundBrush, QTextBlock::begin(), QAbstractTextDocumentLayout::blockBoundingRect(), QTextBlock::blockFormat(), QTextFormat::BlockTrailingHorizontalRulerWidth, QRectF::center(), QTextBlock::charFormat(), QTextFragment::charFormat(), QTextBlockFormat::Checked, QBrush::color(), QString::contains(), currentLine(), QTextDocument::documentLayout(), QTextCharFormat::font(), font, fontMetrics, QTextFormat::foreground(), frame, QTextFormat::hasProperty(), i, QTextFrameFormat::InFlow, QRectF::intersects(), QTextCharFormat::isAnchor(), QString::isEmpty(), QTextBlock::isValid(), layout, QTextBlock::layout(), Qt::LeftToRight, QTextBlock::length(), QTextFragment::length(), line, QTextLayout::lineForTextPosition(), QTextListFormat::ListCircle, QTextListFormat::ListDecimal, QTextListFormat::ListLowerAlpha, QTextListFormat::ListLowerRoman, QTextListFormat::ListSquare, QTextListFormat::ListUpperAlpha, QTextListFormat::ListUpperRoman, QTextBlockFormat::marker(), Qt::NoBrush, QTextBlockFormat::NoMarker, QTextFormat::NoObject, QTextDocument::objectForFormat(), QTextFormat::objectType(), pos, QTextBlock::position(), position(), QTextLayout::preeditAreaPosition(), QTextLayout::preeditAreaText(), QTextFormat::property(), Q_ASSERT, qCDebug, qMakePair(), Qt::RightToLeft, Selected, setCurrentLine(), setCurrentTextDirection(), setPosition(), setTextColor(), QString::size(), QTextLayout::FormatRange::start, QBrush::style(), QTextListFormat::style(), text, QTextFragment::text(), QTextBlock::textDirection(), QTextBlock::textList(), textRect, QTextFormat::TextUnderlineColor, QRect::topLeft(), QRectF::topLeft(), QTextBlockFormat::Unchecked, Unselected, QTextCharFormat::verticalAlignment(), viewport(), QRect::width(), QRectF::width(), QRectF::x(), and QRectF::y().

◆ addTextObject()

void QQuickTextNodeEngine::addTextObject ( const QTextBlock & block,
const QPointF & position,
const QTextCharFormat & format,
SelectionState selectionState,
QTextDocument * textDocument,
int pos,
QTextFrameFormat::Position layoutPosition = QTextFrameFormat::InFlow )

Definition at line 419 of file qquicktextnodeengine.cpp.

References addImage(), QTextCharFormat::AlignBaseline, QTextCharFormat::AlignBottom, QTextCharFormat::AlignMiddle, QTextCharFormat::AlignTop, QTextDocument::documentLayout(), QTextObjectInterface::drawObject(), QImage::Format_ARGB32_Premultiplied, QAbstractTextDocumentLayout::handlerForObject(), QTextImageHandler::image(), QTextFormat::ImageObject, QTextObjectInterface::intrinsicSize(), QTextBlock::layout(), line, QTextLayout::lineForTextPosition(), painter, pos, QTextBlock::position(), position(), QTextFormat::toImageFormat(), and Qt::transparent.

Referenced by addTextBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addToSceneGraph()

◆ addUnselectedGlyphs()

void QQuickTextNodeEngine::addUnselectedGlyphs ( const QGlyphRun & glyphRun)

Definition at line 470 of file qquicktextnodeengine.cpp.

References QQuickTextNodeEngine::BinaryTreeNode::insert(), NoDecoration, and Unselected.

Referenced by addGlyphsInRange(), and addTextBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ currentLine()

QTextLine QQuickTextNodeEngine::currentLine ( ) const
inline

Definition at line 121 of file qquicktextnodeengine_p.h.

Referenced by addText(), addTextBlock(), and setCurrentLine().

+ Here is the caller graph for this function:

◆ hasContents()

bool QQuickTextNodeEngine::hasContents ( ) const
inline

Definition at line 118 of file qquicktextnodeengine_p.h.

◆ mergeProcessedNodes()

void QQuickTextNodeEngine::mergeProcessedNodes ( QList< BinaryTreeNode * > * regularNodes,
QList< BinaryTreeNode * > * imageNodes )

Definition at line 692 of file qquicktextnodeengine.cpp.

References QGlyphRun::boundingRect(), QGlyphRun::glyphIndexes(), QQuickTextNodeEngine::BinaryTreeNode::glyphRun, i, QQuickTextNodeEngine::BinaryTreeNode::image, QGlyphRun::isEmpty(), QImage::isNull(), j, map, QGlyphRun::positions(), Q_ASSERT, QGlyphRun::setBoundingRect(), QGlyphRun::setGlyphIndexes(), QGlyphRun::setPositions(), and QMap< Key, T >::value().

Referenced by addToSceneGraph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAnchorColor()

void QQuickTextNodeEngine::setAnchorColor ( const QColor & anchorColor)
inline

Definition at line 182 of file qquicktextnodeengine_p.h.

◆ setCurrentLine()

void QQuickTextNodeEngine::setCurrentLine ( const QTextLine & currentLine)
inline

Definition at line 123 of file qquicktextnodeengine_p.h.

References currentLine(), and QTextLine::isValid().

Referenced by addText(), and addTextBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCurrentTextDirection()

void QQuickTextNodeEngine::setCurrentTextDirection ( Qt::LayoutDirection textDirection)
inline

Definition at line 131 of file qquicktextnodeengine_p.h.

Referenced by addTextBlock().

+ Here is the caller graph for this function:

◆ setPosition()

void QQuickTextNodeEngine::setPosition ( const QPointF & position)
inline

Definition at line 187 of file qquicktextnodeengine_p.h.

References position().

+ Here is the call graph for this function:

◆ setSelectedTextColor()

void QQuickTextNodeEngine::setSelectedTextColor ( const QColor & selectedTextColor)
inline

Definition at line 172 of file qquicktextnodeengine_p.h.

◆ setSelectionColor()

void QQuickTextNodeEngine::setSelectionColor ( const QColor & selectionColor)
inline

Definition at line 167 of file qquicktextnodeengine_p.h.

◆ setTextColor()

void QQuickTextNodeEngine::setTextColor ( const QColor & textColor)
inline

Definition at line 177 of file qquicktextnodeengine_p.h.

Referenced by addText(), and addTextBlock().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QSGInternalTextNode

friend class QSGInternalTextNode
friend

Definition at line 236 of file qquicktextnodeengine_p.h.


The documentation for this class was generated from the following files: