Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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 141 of file qtextlayout.cpp.

◆ descent()

qreal QTextInlineObject::descent ( ) const

Returns the inline object's descent.

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

Definition at line 151 of file qtextlayout.cpp.

◆ format()

QTextFormat QTextInlineObject::format ( ) const

Returns format of the inline object within the text layout.

Definition at line 217 of file qtextlayout.cpp.

◆ formatIndex()

int QTextInlineObject::formatIndex ( ) const

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

Definition at line 209 of file qtextlayout.cpp.

◆ 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 162 of file qtextlayout.cpp.

◆ 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 120 of file qtextlayout.cpp.

◆ setAscent()

void QTextInlineObject::setAscent ( qreal a)

Sets the inline object's ascent to a.

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

Definition at line 182 of file qtextlayout.cpp.

◆ setDescent()

void QTextInlineObject::setDescent ( qreal d)

Sets the inline object's descent to d.

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

Definition at line 192 of file qtextlayout.cpp.

◆ setWidth()

void QTextInlineObject::setWidth ( qreal w)

Sets the inline object's width to w.

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

Definition at line 172 of file qtextlayout.cpp.

◆ textDirection()

Qt::LayoutDirection QTextInlineObject::textDirection ( ) const

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

Definition at line 225 of file qtextlayout.cpp.

◆ textPosition()

int QTextInlineObject::textPosition ( ) const

The position of the inline object within the text layout.

Definition at line 200 of file qtextlayout.cpp.

◆ width()

qreal QTextInlineObject::width ( ) const

Returns the inline object's width.

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

Definition at line 131 of file qtextlayout.cpp.

◆ QTextLayout

friend class QTextLayout
friend

Definition at line 58 of file qtextlayout.h.


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