Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QTextEngine Class Reference

#include <qtextengine_p.h>

+ Inheritance diagram for QTextEngine:
+ Collaboration diagram for QTextEngine:

Classes

struct  ItemDecoration
 
struct  LayoutData
 

Public Types

enum  LayoutState { LayoutEmpty , InLayout , LayoutFailed }
 
enum  Mode { WidthOnly = 0x07 }
 
typedef QList< ItemDecorationItemDecorationList
 

Public Member Functions

 QTextEngine ()
 
 QTextEngine (const QString &str, const QFont &f)
 
 ~QTextEngine ()
 
void invalidate ()
 
void clearLineData ()
 
void validate () const
 
void itemize () const
 
bool isRightToLeft () const
 
const QCharAttributesattributes () const
 
void shape (int item) const
 
void justify (const QScriptLine &si)
 
QFixed alignLine (const QScriptLine &line)
 
QFixed width (int charFrom, int numChars) const
 
glyph_metrics_t boundingBox (int from, int len) const
 
glyph_metrics_t tightBoundingBox (int from, int len) const
 
int length (int item) const
 
int length (const QScriptItem *si) const
 
QFontEnginefontEngine (const QScriptItem &si, QFixed *ascent=nullptr, QFixed *descent=nullptr, QFixed *leading=nullptr) const
 
QFont font (const QScriptItem &si) const
 
QFont font () const
 
unsigned short * logClusters (const QScriptItem *si) const
 
QGlyphLayout availableGlyphs (const QScriptItem *si) const
 
QGlyphLayout shapedGlyphs (const QScriptItem *si) const
 
bool ensureSpace (int nGlyphs) const
 
void freeMemory ()
 
int findItem (int strPos, int firstItem=0) const
 
QTextFormatCollectionformatCollection () const
 
QTextCharFormat format (const QScriptItem *si) const
 
QAbstractTextDocumentLayoutdocLayout () const
 
int formatIndex (const QScriptItem *si) const
 
QFixed calculateTabWidth (int index, QFixed x) const
 returns the width of tab at index (in the tabs array) with the tab-start at position x
 
bool visualCursorMovement () const
 
int preeditAreaPosition () const
 
QString preeditAreaText () const
 
void setPreeditArea (int position, const QString &text)
 
bool hasFormats () const
 
QList< QTextLayout::FormatRangeformats () const
 
void setFormats (const QList< QTextLayout::FormatRange > &formats)
 
bool atWordSeparator (int position) const
 
QString elidedText (Qt::TextElideMode mode, QFixed width, int flags=0, int from=0, int count=-1) const
 
void shapeLine (const QScriptLine &line)
 
QFixed leadingSpaceWidth (const QScriptLine &line)
 
QFixed offsetInLigature (const QScriptItem *si, int pos, int max, int glyph_pos)
 
int positionInLigature (const QScriptItem *si, int end, QFixed x, QFixed edge, int glyph_pos, bool cursorOnCharacter)
 
int previousLogicalPosition (int oldPos) const
 
int nextLogicalPosition (int oldPos) const
 
int lineNumberForTextPosition (int pos)
 
int positionAfterVisualMovement (int oldPos, QTextCursor::MoveOperation op)
 
std::vector< int > insertionPointsForLine (int lineNum)
 
void resetFontEngineCache ()
 
void enableDelayDecorations (bool enable=true)
 
void addUnderline (QPainter *painter, const QLineF &line)
 
void addStrikeOut (QPainter *painter, const QLineF &line)
 
void addOverline (QPainter *painter, const QLineF &line)
 
void drawDecorations (QPainter *painter)
 
void clearDecorations ()
 
void adjustUnderlines ()
 

Static Public Member Functions

static void bidiReorder (int numRuns, const quint8 *levels, int *visualOrder)
 

Public Attributes

QScriptLineArray lines
 
QString text
 
QFont fnt
 
QRawFont rawFont
 
QTextBlock block
 
QTextOption option
 
QFixed minWidth
 
QFixed maxWidth
 
QPointF position
 
uint ignoreBidi: 1
 
uint cacheGlyphs: 1
 
uint stackEngine: 1
 
uint forceJustification: 1
 
uint visualMovement: 1
 
uint delayDecorations: 1
 
uint useRawFont: 1
 
LayoutDatalayoutData
 
ItemDecorationList underlineList
 
ItemDecorationList strikeOutList
 
ItemDecorationList overlineList
 

Detailed Description

Definition at line 366 of file qtextengine_p.h.

Member Typedef Documentation

◆ ItemDecorationList

Member Enumeration Documentation

◆ LayoutState

Enumerator
LayoutEmpty 
InLayout 
LayoutFailed 

Definition at line 368 of file qtextengine_p.h.

◆ Mode

Enumerator
WidthOnly 

Definition at line 410 of file qtextengine_p.h.

Constructor & Destructor Documentation

◆ QTextEngine() [1/2]

QTextEngine::QTextEngine ( )

Definition at line 1799 of file qtextengine.cpp.

◆ QTextEngine() [2/2]

QTextEngine::QTextEngine ( const QString str,
const QFont f 
)

Definition at line 1804 of file qtextengine.cpp.

◆ ~QTextEngine()

QTextEngine::~QTextEngine ( )

Definition at line 1811 of file qtextengine.cpp.

References layoutData, resetFontEngineCache(), and stackEngine.

+ Here is the call graph for this function:

Member Function Documentation

◆ addOverline()

void QTextEngine::addOverline ( QPainter painter,
const QLineF line 
)

Definition at line 3651 of file qtextengine.cpp.

References line, overlineList, and painter.

Referenced by drawTextItemDecoration().

+ Here is the caller graph for this function:

◆ addStrikeOut()

void QTextEngine::addStrikeOut ( QPainter painter,
const QLineF line 
)

Definition at line 3646 of file qtextengine.cpp.

References line, painter, and strikeOutList.

Referenced by drawTextItemDecoration().

+ Here is the caller graph for this function:

◆ addUnderline()

void QTextEngine::addUnderline ( QPainter painter,
const QLineF line 
)

Definition at line 3640 of file qtextengine.cpp.

References line, painter, and underlineList.

Referenced by drawTextItemDecoration().

+ Here is the caller graph for this function:

◆ adjustUnderlines()

void QTextEngine::adjustUnderlines ( )

Definition at line 3689 of file qtextengine.cpp.

References adjustUnderlines(), QList< T >::begin(), QList< T >::end(), QList< T >::isEmpty(), it, qFuzzyCompare(), qMax(), and underlineList.

Referenced by adjustUnderlines(), and drawDecorations().

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

◆ alignLine()

QFixed QTextEngine::alignLine ( const QScriptLine line)

Definition at line 3382 of file qtextengine.cpp.

References Qt::AlignHCenter, Qt::AlignJustify, Qt::AlignRight, isRightToLeft(), justify(), line, and QFIXED_MAX.

Referenced by QTextLineItemIterator::QTextLineItemIterator(), QTextLine::cursorToX(), QTextLine::naturalTextRect(), and QTextLine::xToCursor().

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

◆ attributes()

◆ atWordSeparator()

bool QTextEngine::atWordSeparator ( int  position) const

Definition at line 2831 of file qtextengine.cpp.

References QString::at(), layoutData, position, and QTextEngine::LayoutData::string.

Referenced by QTextLayout::nextCursorPosition(), and QTextLayout::previousCursorPosition().

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

◆ availableGlyphs()

QGlyphLayout QTextEngine::availableGlyphs ( const QScriptItem si) const
inline

Returns an array of QGlyphLayout items, offset at the script item. Each item in the array matches one glyph in the text, storing the advance, position etc. The returned item's length equals to the number of available glyphs. This may be more than what was actually shaped.

See also
logClusters()

Definition at line 470 of file qtextengine_p.h.

References QScriptItem::glyph_data_offset, and QGlyphLayout::mid().

+ Here is the call graph for this function:

◆ bidiReorder()

void QTextEngine::bidiReorder ( int  numRuns,
const quint8 levels,
int *  visualOrder 
)
static

Definition at line 1139 of file qtextengine.cpp.

References BIDI_DEBUG, i, and j.

Referenced by QTextLineItemIterator::QTextLineItemIterator(), QPainterPath::addText(), QTextLine::cursorToX(), QPainter::drawText(), and QTextLine::xToCursor().

+ Here is the caller graph for this function:

◆ boundingBox()

glyph_metrics_t QTextEngine::boundingBox ( int  from,
int  len 
) const

Definition at line 2191 of file qtextengine.cpp.

References itemize(), and glyph_metrics_t::width.

+ Here is the call graph for this function:

◆ calculateTabWidth()

QFixed QTextEngine::calculateTabWidth ( int  index,
QFixed  x 
) const

◆ clearDecorations()

void QTextEngine::clearDecorations ( )

Definition at line 3682 of file qtextengine.cpp.

References QList< T >::clear(), overlineList, strikeOutList, and underlineList.

Referenced by drawDecorations().

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

◆ clearLineData()

void QTextEngine::clearLineData ( )

Definition at line 1900 of file qtextengine.cpp.

References QList< T >::clear(), and lines.

Referenced by QTextLayout::beginLayout(), QTextLayout::clearLayout(), setFormats(), setPreeditArea(), and QTextLayout::setText().

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

◆ docLayout()

QAbstractTextDocumentLayout * QTextEngine::docLayout ( ) const
inline

Definition at line 498 of file qtextengine_p.h.

References QTextDocumentPrivate::document(), QTextDocument::documentLayout(), QTextDocumentPrivate::get(), and Q_ASSERT.

Referenced by shape().

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

◆ drawDecorations()

void QTextEngine::drawDecorations ( QPainter painter)

Definition at line 3668 of file qtextengine.cpp.

References adjustUnderlines(), clearDecorations(), overlineList, painter, QPainter::pen(), QPainter::setPen(), strikeOutList, and underlineList.

+ Here is the call graph for this function:

◆ elidedText()

◆ enableDelayDecorations()

void QTextEngine::enableDelayDecorations ( bool  enable = true)
inline

Definition at line 604 of file qtextengine_p.h.

◆ ensureSpace()

bool QTextEngine::ensureSpace ( int  nGlyphs) const
inline

Definition at line 483 of file qtextengine_p.h.

Referenced by attributes(), shape(), and shapeLine().

+ Here is the caller graph for this function:

◆ findItem()

int QTextEngine::findItem ( int  strPos,
int  firstItem = 0 
) const

Definition at line 2100 of file qtextengine.cpp.

References QList< T >::at(), itemize(), QTextEngine::LayoutData::items, items, layoutData, QScriptItem::position, QString::size(), QList< T >::size(), and QTextEngine::LayoutData::string.

Referenced by QTextLine::cursorToX(), QTextLayout::drawCursor(), justify(), shapeLine(), and QTextLine::xToCursor().

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

◆ font() [1/2]

QFont QTextEngine::font ( ) const
inline

Definition at line 451 of file qtextengine_p.h.

Referenced by font(), and fontEngine().

+ Here is the caller graph for this function:

◆ font() [2/2]

QFont QTextEngine::font ( const QScriptItem si) const

Definition at line 2236 of file qtextengine.cpp.

References QTextCharFormat::AlignSubScript, QTextCharFormat::AlignSuperScript, QScriptItem::analysis, block, QScriptAnalysis::flags, fnt, font(), QTextDocumentPrivate::get(), hasFormats(), QTextDocumentPrivate::layout(), QAbstractTextDocumentLayout::paintDevice(), QFont::pixelSize(), QFont::pointSize(), QFont::resolve(), QFont::setPixelSize(), QFont::setPointSize(), QScriptAnalysis::SmallCaps, and QFontPrivate::smallCapsFont().

Referenced by QTextLayout::font(), and QTextLine::glyphRuns().

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

◆ fontEngine()

◆ format()

QTextCharFormat QTextEngine::format ( const QScriptItem si) const

Definition at line 2812 of file qtextengine.cpp.

References formatCollection(), and formatIndex().

Referenced by QTextInlineObject::format().

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

◆ formatCollection()

QTextFormatCollection * QTextEngine::formatCollection ( ) const
inline

Definition at line 492 of file qtextengine_p.h.

References QTextDocumentPrivate::formatCollection(), and QTextDocumentPrivate::get().

Referenced by format(), formatIndex(), and itemize().

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

◆ formatIndex()

int QTextEngine::formatIndex ( const QScriptItem si) const

Definition at line 2789 of file qtextengine.cpp.

References QList< T >::at(), block, QSet< T >::find(), formatCollection(), QTextDocumentPrivate::get(), QTextFormatCollection::indexForFormat(), it, QTextEngine::LayoutData::items, layoutData, QTextBlock::length(), pos, QScriptItem::position, QTextBlock::position(), Q_ASSERT, qMax(), and qMin().

Referenced by format(), and QTextInlineObject::formatIndex().

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

◆ formats()

QList< QTextLayout::FormatRange > QTextEngine::formats ( ) const
inline

Definition at line 565 of file qtextengine_p.h.

Referenced by QTextLayout::formats(), and setFormats().

+ Here is the caller graph for this function:

◆ freeMemory()

void QTextEngine::freeMemory ( )

Definition at line 2768 of file qtextengine.cpp.

References QList< T >::clear(), QTextEngine::LayoutData::currentMaxWidth, QTextEngine::LayoutData::hasBidi, QTextEngine::LayoutData::haveCharAttributes, i, QTextEngine::LayoutData::items, layoutData, LayoutEmpty, QTextEngine::LayoutData::layoutState, lines, QList< T >::size(), stackEngine, and QTextEngine::LayoutData::used.

Referenced by QTextLayout::draw(), QTextLayout::endLayout(), and invalidate().

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

◆ hasFormats()

bool QTextEngine::hasFormats ( ) const
inline

Definition at line 563 of file qtextengine_p.h.

References QTextDocumentPrivate::get().

Referenced by font(), and fontEngine().

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

◆ insertionPointsForLine()

std::vector< int > QTextEngine::insertionPointsForLine ( int  lineNum)

Definition at line 3550 of file qtextengine.cpp.

References QScriptItem::analysis, QScriptAnalysis::bidiLevel, i, lines, and QList< T >::size().

Referenced by positionAfterVisualMovement(), and QTextLine::xToCursor().

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

◆ invalidate()

void QTextEngine::invalidate ( )

Definition at line 1891 of file qtextengine.cpp.

References freeMemory(), maxWidth, minWidth, and resetFontEngineCache().

Referenced by QTextLayout::beginLayout(), QTextBlockData::invalidate(), setFormats(), setPreeditArea(), and QTextLayout::setText().

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

◆ isRightToLeft()

bool QTextEngine::isRightToLeft ( ) const

Definition at line 2081 of file qtextengine.cpp.

References QInputMethod::inputDirection, QGuiApplication::inputMethod(), QString::isEmpty(), QString::isRightToLeft(), itemize(), layoutData, Qt::LeftToRight, Qt::RightToLeft, and QTextEngine::LayoutData::string.

Referenced by alignLine(), calculateTabWidth(), QTextLine::cursorToX(), QTextLayout::draw(), QTextLayout::drawCursor(), itemize(), leadingSpaceWidth(), positionAfterVisualMovement(), and QTextLine::xToCursor().

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

◆ itemize()

void QTextEngine::itemize ( ) const

Definition at line 1926 of file qtextengine.cpp.

References QVarLengthArray< T, Prealloc >::at(), QScriptAnalysis::bidiLevel, block, QFontPrivate::capital, QFont::capitalization(), QTextFormatCollection::charFormat(), QString::constData(), QVarLengthArray< T, Prealloc >::data(), QTextFormatCollection::defaultFont(), QString::detach(), e, QSet< T >::find(), QScriptAnalysis::flags, fnt, QTextFormat::FontCapitalization, QTextCharFormat::fontCapitalization(), QTextFragmentData::format, formatCollection(), QTextDocumentPrivate::get(), QAbstractTextDocumentLayoutPrivate::get(), QTextEngine::LayoutData::hasBidi, QAbstractTextDocumentLayoutPrivate::hasHandlers(), QTextFormat::hasProperty(), i, QUnicodeTools::initScripts(), isRightToLeft(), it, item, QTextEngine::LayoutData::items, j, QTextDocumentPrivate::layout(), layoutData, QTextBlock::length(), QScriptAnalysis::LineOrParagraphSeparator, QChar::LineSeparator, QFont::MixedCase, QChar::Nbsp, QScriptAnalysis::Nbsp, QScriptAnalysis::None, QScriptAnalysis::Object, QChar::ObjectReplacementCharacter, position, QTextBlock::position(), Q_ASSERT, Q_FALLTHROUGH, QTextOption::ShowLineAndParagraphSeparators, QTextOption::ShowTabsAndSpaces, QString::size(), QList< T >::size(), QVLABaseBase::size(), QFragment< N >::size_array, QChar::Space, QScriptAnalysis::Space, QTextEngine::LayoutData::string, QScriptAnalysis::Tab, QChar::Tabulation, QString::unicode(), useRawFont, and validate().

Referenced by attributes(), QTextLayout::beginLayout(), boundingBox(), QTextLine::cursorToX(), QTextLayout::draw(), QTextLayout::drawCursor(), elidedText(), findItem(), isRightToLeft(), justify(), lineNumberForTextPosition(), positionAfterVisualMovement(), tightBoundingBox(), width(), and QTextLine::xToCursor().

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

◆ justify()

◆ leadingSpaceWidth()

QFixed QTextEngine::leadingSpaceWidth ( const QScriptLine line)

Definition at line 3372 of file qtextengine.cpp.

References QTextOption::IncludeTrailingSpaces, isRightToLeft(), QString::length(), and line.

Referenced by QTextLine::cursorToX(), QTextLayout::draw(), and justify().

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

◆ length() [1/2]

int QTextEngine::length ( const QScriptItem si) const
inline

Definition at line 440 of file qtextengine_p.h.

References QScriptItem::position, and position().

+ Here is the call graph for this function:

◆ length() [2/2]

int QTextEngine::length ( int  item) const
inline

Definition at line 434 of file qtextengine_p.h.

References item, items, QScriptItem::position, and QList< T >::size().

Referenced by QTextLine::cursorToX(), QTextLineItemIterator::next(), and QTextLine::xToCursor().

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

◆ lineNumberForTextPosition()

int QTextEngine::lineNumberForTextPosition ( int  pos)

Definition at line 3536 of file qtextengine.cpp.

References i, itemize(), layoutData, QString::length(), line, lines, pos, QString::size(), QList< T >::size(), and QTextEngine::LayoutData::string.

Referenced by QTextLayout::drawCursor(), QTextLayout::lineForTextPosition(), and positionAfterVisualMovement().

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

◆ logClusters()

unsigned short * QTextEngine::logClusters ( const QScriptItem si) const
inline

Returns a pointer to an array of log clusters, offset at the script item. Each item in the array is a unsigned short. For each character in the original string there is an entry in the table so there is a one to one correlation in indexes between the original text and the index in the logcluster. The value of each item is the position in the glyphs array. Multiple similar pointers in the logclusters array imply that one glyph is used for more than one character.

See also
glyphs()

Definition at line 461 of file qtextengine_p.h.

References QScriptItem::position.

Referenced by QTextLine::cursorToX(), elidedText(), QTextLineItemIterator::getSelectionBounds(), QTextLine::glyphRuns(), justify(), QTextLineItemIterator::next(), offsetInLigature(), positionInLigature(), shape(), and QTextLine::xToCursor().

+ Here is the caller graph for this function:

◆ nextLogicalPosition()

int QTextEngine::nextLogicalPosition ( int  oldPos) const

Definition at line 3521 of file qtextengine.cpp.

References attributes(), attrs, block, QTextBlock::isValid(), layoutData, QTextBlock::length(), Q_ASSERT, QString::size(), and QTextEngine::LayoutData::string.

Referenced by positionAfterVisualMovement().

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

◆ offsetInLigature()

QFixed QTextEngine::offsetInLigature ( const QScriptItem si,
int  pos,
int  max,
int  glyph_pos 
)

Definition at line 3399 of file qtextengine.cpp.

References QGlyphLayout::advances, i, logClusters(), pos, and shapedGlyphs().

Referenced by QTextLine::cursorToX(), and QTextLineItemIterator::getSelectionBounds().

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

◆ positionAfterVisualMovement()

int QTextEngine::positionAfterVisualMovement ( int  oldPos,
QTextCursor::MoveOperation  op 
)

Definition at line 3592 of file qtextengine.cpp.

References QTextEngine::LayoutData::hasBidi, i, insertionPointsForLine(), isRightToLeft(), itemize(), layoutData, lineNumberForTextPosition(), lines, nextLogicalPosition(), pos, previousLogicalPosition(), QTextCursor::Right, and QList< T >::size().

Referenced by QTextLayout::leftCursorPosition(), and QTextLayout::rightCursorPosition().

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

◆ positionInLigature()

int QTextEngine::positionInLigature ( const QScriptItem si,
int  end,
QFixed  x,
QFixed  edge,
int  glyph_pos,
bool  cursorOnCharacter 
)

Definition at line 3447 of file qtextengine.cpp.

References QScriptItem::analysis, attributes(), attrs, dist(), QGlyphLayout::effectiveAdvance(), QFixed::floor(), i, logClusters(), pos, QScriptItem::position, QScriptAnalysis::script, QChar::Script_Bopomofo, QChar::Script_Common, QChar::Script_Greek, QChar::Script_Han, QChar::Script_Hiragana, QChar::Script_Katakana, QChar::Script_Latin, shapedGlyphs(), and QFixed::toInt().

Referenced by QTextLine::xToCursor().

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

◆ preeditAreaPosition()

int QTextEngine::preeditAreaPosition ( ) const
inline

Definition at line 559 of file qtextengine_p.h.

Referenced by QTextLayout::preeditAreaPosition(), and QTextLayout::setPreeditArea().

+ Here is the caller graph for this function:

◆ preeditAreaText()

QString QTextEngine::preeditAreaText ( ) const
inline

Definition at line 560 of file qtextengine_p.h.

Referenced by QTextLayout::preeditAreaText(), and QTextLayout::setPreeditArea().

+ Here is the caller graph for this function:

◆ previousLogicalPosition()

int QTextEngine::previousLogicalPosition ( int  oldPos) const

Definition at line 3506 of file qtextengine.cpp.

References attributes(), attrs, block, QTextBlock::isValid(), layoutData, QTextBlock::length(), Q_ASSERT, QString::size(), and QTextEngine::LayoutData::string.

Referenced by positionAfterVisualMovement(), and QTextLine::xToCursor().

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

◆ resetFontEngineCache()

void QTextEngine::resetFontEngineCache ( )

Definition at line 1884 of file qtextengine.cpp.

References releaseCachedFontEngine().

Referenced by ~QTextEngine(), invalidate(), QQuickText::invalidateFontCaches(), QTextLayout::setFont(), and QTextLayout::setRawFont().

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

◆ setFormats()

void QTextEngine::setFormats ( const QList< QTextLayout::FormatRange > &  formats)

Definition at line 2895 of file qtextengine.cpp.

References clearLineData(), formats(), and invalidate().

Referenced by QTextLayout::setFormats().

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

◆ setPreeditArea()

void QTextEngine::setPreeditArea ( int  position,
const QString text 
)

Definition at line 2873 of file qtextengine.cpp.

References clearLineData(), invalidate(), QString::isEmpty(), and position.

Referenced by QTextLayout::setPreeditArea().

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

◆ shape()

void QTextEngine::shape ( int  item) const

Definition at line 1849 of file qtextengine.cpp.

References block, docLayout(), ensureSpace(), fontEngine(), QTextDocumentPrivate::get(), item, QTextEngine::LayoutData::items, layoutData, logClusters(), QTextEngine::LayoutData::logClustersPtr, QScriptAnalysis::Object, QTextBlock::position(), QAbstractTextDocumentLayout::resizeInlineObject(), and QScriptAnalysis::Tab.

Referenced by calculateTabWidth(), QTextLine::cursorToX(), elidedText(), justify(), QTextLineItemIterator::next(), and shapeLine().

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

◆ shapedGlyphs()

QGlyphLayout QTextEngine::shapedGlyphs ( const QScriptItem si) const
inline

Returns an array of QGlyphLayout items, offset at the script item. Each item in the array matches one glyph in the text, storing the advance, position etc. The returned item's length equals to the number of shaped glyphs.

See also
logClusters()

Definition at line 479 of file qtextengine_p.h.

References QScriptItem::glyph_data_offset, QGlyphLayout::mid(), and QScriptItem::num_glyphs.

Referenced by QPainterPath::addText(), calculateTabWidth(), QTextLine::cursorToX(), elidedText(), QTextLineItemIterator::getSelectionBounds(), QTextLine::glyphRuns(), justify(), QTextLineItemIterator::next(), offsetInLigature(), positionInLigature(), shapeLine(), width(), and QTextLine::xToCursor().

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

◆ shapeLine()

void QTextEngine::shapeLine ( const QScriptLine line)

Definition at line 1292 of file qtextengine.cpp.

References QScriptItem::analysis, calculateTabWidth(), QGlyphLayout::effectiveAdvance(), ensureSpace(), findItem(), QScriptAnalysis::flags, i, item, QTextEngine::LayoutData::items, layoutData, QString::length(), line, QScriptItem::position, Q_ASSERT, shape(), shapedGlyphs(), QScriptAnalysis::Tab, and QScriptItem::width.

Referenced by QTextLineItemIterator::QTextLineItemIterator(), QTextLine::cursorToX(), and QTextLine::xToCursor().

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

◆ tightBoundingBox()

glyph_metrics_t QTextEngine::tightBoundingBox ( int  from,
int  len 
) const

Definition at line 2214 of file qtextengine.cpp.

References itemize(), and glyph_metrics_t::width.

+ Here is the call graph for this function:

◆ validate()

void QTextEngine::validate ( ) const

Definition at line 1905 of file qtextengine.cpp.

References block, QTextDocumentPrivate::get(), QString::insert(), QTextBlock::isValid(), layoutData, QTextBlock::next(), QTextOption::ShowDocumentTerminator, QTextOption::ShowLineAndParagraphSeparators, QTextEngine::LayoutData::string, text, and QTextBlock::text().

Referenced by elidedText(), and itemize().

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

◆ visualCursorMovement()

bool QTextEngine::visualCursorMovement ( ) const
inline

Definition at line 556 of file qtextengine_p.h.

References QTextDocumentPrivate::defaultCursorMoveStyle, QTextDocumentPrivate::get(), and Qt::VisualMoveStyle.

Referenced by QTextLine::cursorToX(), QTextLayout::drawCursor(), and QTextLine::xToCursor().

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

◆ width()

QFixed QTextEngine::width ( int  charFrom,
int  numChars 
) const

Definition at line 2176 of file qtextengine.cpp.

References QGlyphLayout::advances, QGlyphLayout::attributes, QGlyphAttributes::dontPrint, itemize(), j, and shapedGlyphs().

+ Here is the call graph for this function:

Member Data Documentation

◆ block

◆ cacheGlyphs

uint QTextEngine::cacheGlyphs

◆ delayDecorations

uint QTextEngine::delayDecorations

Definition at line 545 of file qtextengine_p.h.

◆ fnt

◆ forceJustification

uint QTextEngine::forceJustification

Definition at line 543 of file qtextengine_p.h.

Referenced by justify(), and QTextLayout::setFlags().

◆ ignoreBidi

uint QTextEngine::ignoreBidi

Definition at line 540 of file qtextengine_p.h.

Referenced by QTextLayout::setFlags().

◆ layoutData

◆ lines

◆ maxWidth

QFixed QTextEngine::maxWidth

Definition at line 538 of file qtextengine_p.h.

Referenced by QTextLayout::createLine(), invalidate(), and QTextLayout::maximumWidth().

◆ minWidth

QFixed QTextEngine::minWidth

Definition at line 537 of file qtextengine_p.h.

Referenced by invalidate(), and QTextLayout::minimumWidth().

◆ option

◆ overlineList

ItemDecorationList QTextEngine::overlineList

Definition at line 554 of file qtextengine_p.h.

Referenced by addOverline(), clearDecorations(), and drawDecorations().

◆ position

◆ rawFont

QRawFont QTextEngine::rawFont

Definition at line 531 of file qtextengine_p.h.

Referenced by fontEngine(), QTextLine::glyphRuns(), and QTextLayout::setRawFont().

◆ stackEngine

uint QTextEngine::stackEngine

◆ strikeOutList

ItemDecorationList QTextEngine::strikeOutList

Definition at line 553 of file qtextengine_p.h.

Referenced by addStrikeOut(), clearDecorations(), and drawDecorations().

◆ text

◆ underlineList

ItemDecorationList QTextEngine::underlineList

Definition at line 552 of file qtextengine_p.h.

Referenced by addUnderline(), adjustUnderlines(), clearDecorations(), and drawDecorations().

◆ useRawFont

uint QTextEngine::useRawFont

◆ visualMovement

uint QTextEngine::visualMovement

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