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

\reentrant More...

#include <qtextlayout.h>

+ Collaboration diagram for QTextInlineObject:

Public Member Functions

 QTextInlineObject (int i, QTextEngine *e)
 
 QTextInlineObject ()
 
bool isValid () const
 Returns true if this inline object is valid; otherwise returns false.
 
QRectF rect () const
 Returns the inline object's rectangle.
 
qreal width () const
 Returns the inline object's width.
 
qreal ascent () const
 Returns the inline object's ascent.
 
qreal descent () const
 Returns the inline object's descent.
 
qreal height () const
 Returns the inline object's total height.
 
Qt::LayoutDirection textDirection () const
 Returns if the object should be laid out right-to-left or left-to-right.
 
void setWidth (qreal w)
 Sets the inline object's width to w.
 
void setAscent (qreal a)
 Sets the inline object's ascent to a.
 
void setDescent (qreal d)
 Sets the inline object's descent to d.
 
int textPosition () const
 The position of the inline object within the text layout.
 
int formatIndex () const
 Returns an integer describing the format of the inline object within the text layout.
 
QTextFormat format () const
 Returns format of the inline object within the text layout.
 

Friends

class QTextLayout
 

Detailed Description

\reentrant

The QTextInlineObject class represents an inline object in a QAbstractTextDocumentLayout and its implementations. \inmodule QtGui

Normally, you do not need to create a QTextInlineObject. It is used by QAbstractTextDocumentLayout to handle inline objects when implementing a custom layout.

The inline object has various attributes that can be set, for example using, setWidth(), setAscent(), and setDescent(). The rectangle it occupies is given by rect(), and its direction by textDirection(). Its position in the text layout is given by textPosition(), and its format is given by format().

Definition at line 33 of file qtextlayout.h.

Constructor & Destructor Documentation

◆ QTextInlineObject() [1/2]

QTextInlineObject::QTextInlineObject ( int i,
QTextEngine * e )
inline

Creates a new inline object for the item at position i in the text engine e.

Definition at line 36 of file qtextlayout.h.

◆ QTextInlineObject() [2/2]

QTextInlineObject::QTextInlineObject ( )
inline

Definition at line 37 of file qtextlayout.h.

Member Function Documentation

◆ ascent()

qreal QTextInlineObject::ascent ( ) const

Returns the inline object's ascent.

See also
descent(), width(), rect()

Definition at line 140 of file qtextlayout.cpp.

References QScriptItem::ascent, QList< T >::at(), QTextEngine::LayoutData::items, QTextEngine::layoutData, and QFixed::toReal().

+ Here is the call graph for this function:

◆ descent()

qreal QTextInlineObject::descent ( ) const

Returns the inline object's descent.

See also
ascent(), width(), rect()

Definition at line 150 of file qtextlayout.cpp.

References QList< T >::at(), QScriptItem::descent, QTextEngine::LayoutData::items, QTextEngine::layoutData, and QFixed::toReal().

+ Here is the call graph for this function:

◆ format()

QTextFormat QTextInlineObject::format ( ) const

Returns format of the inline object within the text layout.

Definition at line 216 of file qtextlayout.cpp.

References QTextEngine::format(), QTextEngine::LayoutData::items, and QTextEngine::layoutData.

+ Here is the call graph for this function:

◆ formatIndex()

int QTextInlineObject::formatIndex ( ) const

Returns an integer describing the format of the inline object within the text layout.

Definition at line 208 of file qtextlayout.cpp.

References QTextEngine::formatIndex(), QTextEngine::LayoutData::items, and QTextEngine::layoutData.

+ Here is the call graph for this function:

◆ height()

qreal QTextInlineObject::height ( ) const

Returns the inline object's total height.

This is equal to ascent() + descent() + 1.

See also
ascent(), descent(), width(), rect()

Definition at line 161 of file qtextlayout.cpp.

References QList< T >::at(), QScriptItem::height(), QTextEngine::LayoutData::items, and QTextEngine::layoutData.

+ Here is the call graph for this function:

◆ isValid()

bool QTextInlineObject::isValid ( ) const
inline

Returns true if this inline object is valid; otherwise returns false.

Definition at line 38 of file qtextlayout.h.

◆ rect()

QRectF QTextInlineObject::rect ( ) const

Returns the inline object's rectangle.

See also
ascent(), descent(), width()

Definition at line 119 of file qtextlayout.cpp.

References QScriptItem::ascent, QScriptItem::height(), QTextEngine::LayoutData::items, QTextEngine::layoutData, QFixed::toReal(), and QScriptItem::width.

+ Here is the call graph for this function:

◆ setAscent()

void QTextInlineObject::setAscent ( qreal a)

Sets the inline object's ascent to a.

See also
ascent(), setDescent(), width(), rect()

Definition at line 181 of file qtextlayout.cpp.

References QFixed::fromReal(), QTextEngine::LayoutData::items, and QTextEngine::layoutData.

+ Here is the call graph for this function:

◆ setDescent()

void QTextInlineObject::setDescent ( qreal d)

Sets the inline object's descent to d.

See also
descent(), setAscent(), width(), rect()

Definition at line 191 of file qtextlayout.cpp.

References d, QFixed::fromReal(), QTextEngine::LayoutData::items, and QTextEngine::layoutData.

+ Here is the call graph for this function:

◆ setWidth()

void QTextInlineObject::setWidth ( qreal w)

Sets the inline object's width to w.

See also
width(), ascent(), descent(), rect()

Definition at line 171 of file qtextlayout.cpp.

References QFixed::fromReal(), QTextEngine::LayoutData::items, and QTextEngine::layoutData.

+ Here is the call graph for this function:

◆ textDirection()

Qt::LayoutDirection QTextInlineObject::textDirection ( ) const

Returns if the object should be laid out right-to-left or left-to-right.

Definition at line 224 of file qtextlayout.cpp.

References QTextEngine::LayoutData::items, QTextEngine::layoutData, Qt::LeftToRight, and Qt::RightToLeft.

◆ textPosition()

int QTextInlineObject::textPosition ( ) const

The position of the inline object within the text layout.

Definition at line 199 of file qtextlayout.cpp.

References QTextEngine::LayoutData::items, and QTextEngine::layoutData.

◆ width()

qreal QTextInlineObject::width ( ) const

Returns the inline object's width.

See also
ascent(), descent(), rect()

Definition at line 130 of file qtextlayout.cpp.

References QList< T >::at(), QTextEngine::LayoutData::items, QTextEngine::layoutData, QFixed::toReal(), and QScriptItem::width.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ QTextLayout

friend class QTextLayout
friend

Definition at line 58 of file qtextlayout.h.


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