![]() |
Qt 6.x
The Qt SDK
|
\reentrant More...
#include <qtextlayout.h>
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 |
\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.
|
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.
|
inline |
Definition at line 37 of file qtextlayout.h.
qreal QTextInlineObject::ascent | ( | ) | const |
Returns the inline object's ascent.
Definition at line 140 of file qtextlayout.cpp.
References QScriptItem::ascent, QList< T >::at(), QTextEngine::LayoutData::items, QTextEngine::layoutData, and QFixed::toReal().
qreal QTextInlineObject::descent | ( | ) | const |
Returns the inline object's descent.
Definition at line 150 of file qtextlayout.cpp.
References QList< T >::at(), QScriptItem::descent, QTextEngine::LayoutData::items, QTextEngine::layoutData, and QFixed::toReal().
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.
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.
qreal QTextInlineObject::height | ( | ) | const |
Returns the inline object's total height.
This is equal to ascent() + descent() + 1.
Definition at line 161 of file qtextlayout.cpp.
References QList< T >::at(), QScriptItem::height(), QTextEngine::LayoutData::items, QTextEngine::layoutData, and QFixed::toReal().
|
inline |
Returns true
if this inline object is valid; otherwise returns false.
Definition at line 38 of file qtextlayout.h.
QRectF QTextInlineObject::rect | ( | ) | const |
Returns the inline object's rectangle.
Definition at line 119 of file qtextlayout.cpp.
References QScriptItem::ascent, QScriptItem::height(), QTextEngine::LayoutData::items, QTextEngine::layoutData, QFixed::toReal(), and QScriptItem::width.
Sets the inline object's ascent to a.
Definition at line 181 of file qtextlayout.cpp.
References QFixed::fromReal(), QTextEngine::LayoutData::items, and QTextEngine::layoutData.
Sets the inline object's descent to d.
Definition at line 191 of file qtextlayout.cpp.
References d, QFixed::fromReal(), QTextEngine::LayoutData::items, and QTextEngine::layoutData.
Sets the inline object's width to w.
Definition at line 171 of file qtextlayout.cpp.
References QFixed::fromReal(), QTextEngine::LayoutData::items, and QTextEngine::layoutData.
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.
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.
qreal QTextInlineObject::width | ( | ) | const |
Returns the inline object's width.
Definition at line 130 of file qtextlayout.cpp.
References QList< T >::at(), QTextEngine::LayoutData::items, QTextEngine::layoutData, QFixed::toReal(), and QScriptItem::width.
|
friend |
Definition at line 58 of file qtextlayout.h.