QtBase  v6.3.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
QTextEngine Class Reference

#include <qtextengine_p.h>

Inheritance diagram for QTextEngine:
Inheritance graph
[legend]
Collaboration diagram for QTextEngine:
Collaboration graph
[legend]

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 More...
 
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, const 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 402 of file qtextengine_p.h.

Member Typedef Documentation

◆ ItemDecorationList

Definition at line 439 of file qtextengine_p.h.

Member Enumeration Documentation

◆ LayoutState

Enumerator
LayoutEmpty 
InLayout 
LayoutFailed 

Definition at line 404 of file qtextengine_p.h.

◆ Mode

Enumerator
WidthOnly 

Definition at line 445 of file qtextengine_p.h.

Constructor & Destructor Documentation

◆ QTextEngine() [1/2]

QTextEngine::QTextEngine ( )

Definition at line 1795 of file qtextengine.cpp.

◆ QTextEngine() [2/2]

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

Definition at line 1800 of file qtextengine.cpp.

◆ ~QTextEngine()

QTextEngine::~QTextEngine ( )

Definition at line 1807 of file qtextengine.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ addOverline()

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

Definition at line 3634 of file qtextengine.cpp.

◆ addStrikeOut()

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

Definition at line 3629 of file qtextengine.cpp.

◆ addUnderline()

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

Definition at line 3623 of file qtextengine.cpp.

◆ adjustUnderlines()

void QTextEngine::adjustUnderlines ( )

Definition at line 3672 of file qtextengine.cpp.

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 3365 of file qtextengine.cpp.

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

◆ attributes()

const QCharAttributes * QTextEngine::attributes ( ) const

Definition at line 1815 of file qtextengine.cpp.

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

◆ atWordSeparator()

bool QTextEngine::atWordSeparator ( int  position) const

Definition at line 2814 of file qtextengine.cpp.

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 505 of file qtextengine_p.h.

Here is the call graph for this function:

◆ bidiReorder()

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

Definition at line 1174 of file qtextengine.cpp.

Here is the caller graph for this function:

◆ boundingBox()

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

Definition at line 2177 of file qtextengine.cpp.

Here is the call graph for this function:

◆ calculateTabWidth()

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

returns the width of tab at index (in the tabs array) with the tab-start at position x

Definition at line 3169 of file qtextengine.cpp.

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

◆ clearDecorations()

void QTextEngine::clearDecorations ( )

Definition at line 3665 of file qtextengine.cpp.

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

◆ clearLineData()

void QTextEngine::clearLineData ( )

Definition at line 1896 of file qtextengine.cpp.

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 533 of file qtextengine_p.h.

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 3651 of file qtextengine.cpp.

Here is the call graph for this function:

◆ elidedText()

QString QTextEngine::elidedText ( Qt::TextElideMode  mode,
const QFixed width,
int  flags = 0,
int  from = 0,
int  count = -1 
) const

Definition at line 2973 of file qtextengine.cpp.

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

◆ enableDelayDecorations()

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

Definition at line 639 of file qtextengine_p.h.

◆ ensureSpace()

bool QTextEngine::ensureSpace ( int  nGlyphs) const
inline

Definition at line 518 of file qtextengine_p.h.

Here is the caller graph for this function:

◆ findItem()

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

Definition at line 2086 of file qtextengine.cpp.

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 486 of file qtextengine_p.h.

Here is the caller graph for this function:

◆ font() [2/2]

QFont QTextEngine::font ( const QScriptItem si) const

Definition at line 2222 of file qtextengine.cpp.

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

◆ fontEngine()

QFontEngine * QTextEngine::fontEngine ( const QScriptItem si,
QFixed ascent = nullptr,
QFixed descent = nullptr,
QFixed leading = nullptr 
) const

Definition at line 2260 of file qtextengine.cpp.

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

◆ format()

QTextCharFormat QTextEngine::format ( const QScriptItem si) const

Definition at line 2795 of file qtextengine.cpp.

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 527 of file qtextengine_p.h.

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 2772 of file qtextengine.cpp.

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 600 of file qtextengine_p.h.

Here is the caller graph for this function:

◆ freeMemory()

void QTextEngine::freeMemory ( )

Definition at line 2752 of file qtextengine.cpp.

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 598 of file qtextengine_p.h.

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 3533 of file qtextengine.cpp.

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

◆ invalidate()

void QTextEngine::invalidate ( )

Definition at line 1887 of file qtextengine.cpp.

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

◆ isRightToLeft()

bool QTextEngine::isRightToLeft ( ) const

Definition at line 2067 of file qtextengine.cpp.

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

◆ itemize()

void QTextEngine::itemize ( ) const

Definition at line 1922 of file qtextengine.cpp.

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

◆ justify()

void QTextEngine::justify ( const QScriptLine si)

Definition at line 2421 of file qtextengine.cpp.

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

◆ leadingSpaceWidth()

QFixed QTextEngine::leadingSpaceWidth ( const QScriptLine line)

Definition at line 3355 of file qtextengine.cpp.

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 475 of file qtextengine_p.h.

Here is the call graph for this function:

◆ length() [2/2]

int QTextEngine::length ( int  item) const
inline

Definition at line 469 of file qtextengine_p.h.

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 3519 of file qtextengine.cpp.

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 496 of file qtextengine_p.h.

Here is the caller graph for this function:

◆ nextLogicalPosition()

int QTextEngine::nextLogicalPosition ( int  oldPos) const

Definition at line 3504 of file qtextengine.cpp.

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 3382 of file qtextengine.cpp.

Here is the call graph for this function:

◆ positionAfterVisualMovement()

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

Definition at line 3575 of file qtextengine.cpp.

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 3430 of file qtextengine.cpp.

Here is the call graph for this function:

◆ preeditAreaPosition()

int QTextEngine::preeditAreaPosition ( ) const
inline

Definition at line 594 of file qtextengine_p.h.

Here is the caller graph for this function:

◆ preeditAreaText()

QString QTextEngine::preeditAreaText ( ) const
inline

Definition at line 595 of file qtextengine_p.h.

Here is the caller graph for this function:

◆ previousLogicalPosition()

int QTextEngine::previousLogicalPosition ( int  oldPos) const

Definition at line 3489 of file qtextengine.cpp.

Here is the caller graph for this function:

◆ resetFontEngineCache()

void QTextEngine::resetFontEngineCache ( )

Definition at line 1880 of file qtextengine.cpp.

Here is the caller graph for this function:

◆ setFormats()

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

Definition at line 2878 of file qtextengine.cpp.

Here is the call graph for this function:

◆ setPreeditArea()

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

Definition at line 2856 of file qtextengine.cpp.

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 1845 of file qtextengine.cpp.

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 514 of file qtextengine_p.h.

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 1327 of file qtextengine.cpp.

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 2200 of file qtextengine.cpp.

Here is the call graph for this function:

◆ validate()

void QTextEngine::validate ( ) const

Definition at line 1901 of file qtextengine.cpp.

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 591 of file qtextengine_p.h.

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 2162 of file qtextengine.cpp.

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

Member Data Documentation

◆ block

QTextBlock QTextEngine::block

Definition at line 568 of file qtextengine_p.h.

◆ cacheGlyphs

uint QTextEngine::cacheGlyphs

Definition at line 576 of file qtextengine_p.h.

◆ delayDecorations

uint QTextEngine::delayDecorations

Definition at line 580 of file qtextengine_p.h.

◆ fnt

QFont QTextEngine::fnt
mutable

Definition at line 564 of file qtextengine_p.h.

◆ forceJustification

uint QTextEngine::forceJustification

Definition at line 578 of file qtextengine_p.h.

◆ ignoreBidi

uint QTextEngine::ignoreBidi

Definition at line 575 of file qtextengine_p.h.

◆ layoutData

LayoutData* QTextEngine::layoutData
mutable

Definition at line 585 of file qtextengine_p.h.

◆ lines

QScriptLineArray QTextEngine::lines
mutable

Definition at line 542 of file qtextengine_p.h.

◆ maxWidth

QFixed QTextEngine::maxWidth

Definition at line 573 of file qtextengine_p.h.

◆ minWidth

QFixed QTextEngine::minWidth

Definition at line 572 of file qtextengine_p.h.

◆ option

QTextOption QTextEngine::option

Definition at line 570 of file qtextengine_p.h.

◆ overlineList

ItemDecorationList QTextEngine::overlineList

Definition at line 589 of file qtextengine_p.h.

◆ position

QPointF QTextEngine::position

Definition at line 574 of file qtextengine_p.h.

◆ rawFont

QRawFont QTextEngine::rawFont

Definition at line 566 of file qtextengine_p.h.

◆ stackEngine

uint QTextEngine::stackEngine

Definition at line 577 of file qtextengine_p.h.

◆ strikeOutList

ItemDecorationList QTextEngine::strikeOutList

Definition at line 588 of file qtextengine_p.h.

◆ text

QString QTextEngine::text

Definition at line 563 of file qtextengine_p.h.

◆ underlineList

ItemDecorationList QTextEngine::underlineList

Definition at line 587 of file qtextengine_p.h.

◆ useRawFont

uint QTextEngine::useRawFont

Definition at line 582 of file qtextengine_p.h.

◆ visualMovement

uint QTextEngine::visualMovement

Definition at line 579 of file qtextengine_p.h.


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