Qt 4.8
|
The QTextInlineObject class represents an inline object in a QTextLayout. More...
#include <qtextlayout.h>
Public Functions | |
qreal | ascent () const |
Returns the inline object's ascent. More... | |
qreal | descent () const |
Returns the inline object's descent. More... | |
QTextFormat | format () const |
Returns format of the inline object within the text layout. More... | |
int | formatIndex () const |
Returns an integer describing the format of the inline object within the text layout. More... | |
qreal | height () const |
Returns the inline object's total height. More... | |
bool | isValid () const |
Returns true if this inline object is valid; otherwise returns false. More... | |
QTextInlineObject (int i, QTextEngine *e) | |
Creates a new inline object for the item at position i in the text engine e. More... | |
QTextInlineObject () | |
QRectF | rect () const |
Returns the inline object's rectangle. More... | |
void | setAscent (qreal a) |
Sets the inline object's ascent to a. More... | |
void | setDescent (qreal d) |
Sets the inline object's decent to d. More... | |
void | setWidth (qreal w) |
Sets the inline object's width to w. More... | |
Qt::LayoutDirection | textDirection () const |
Returns if the object should be laid out right-to-left or left-to-right. More... | |
int | textPosition () const |
The position of the inline object within the text layout. More... | |
qreal | width () const |
Returns the inline object's width. More... | |
Properties | |
QTextEngine * | eng |
int | itm |
Friends | |
class | QTextLayout |
The QTextInlineObject class represents an inline object in a QTextLayout.
This class is only used if the text layout is used to lay out parts of a QTextDocument.
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 isRightToLeft(). Its position in the text layout is given by at(), and its format is given by format().
Definition at line 69 of file qtextlayout.h.
|
inline |
Creates a new inline object for the item at position i in the text engine e.
Definition at line 72 of file qtextlayout.h.
|
inline |
Definition at line 73 of file qtextlayout.h.
Referenced by QTextLine::draw(), and QTextLine::layout_helper().
qreal QTextInlineObject::ascent | ( | ) | const |
qreal QTextInlineObject::descent | ( | ) | const |
Returns the inline object's descent.
Definition at line 194 of file qtextlayout.cpp.
Referenced by QTextLayout::drawCursor().
QTextFormat QTextInlineObject::format | ( | ) | const |
Returns format of the inline object within the text layout.
Definition at line 260 of file qtextlayout.cpp.
Referenced by QTextLine::draw(), and QTextLine::layout_helper().
int QTextInlineObject::formatIndex | ( | ) | const |
Returns an integer describing the format of the inline object within the text layout.
Definition at line 252 of file qtextlayout.cpp.
qreal QTextInlineObject::height | ( | ) | const |
Returns the inline object's total height.
This is equal to ascent() + descent() + 1.
Definition at line 205 of file qtextlayout.cpp.
Referenced by QTextLine::draw().
|
inline |
Returns true if this inline object is valid; otherwise returns false.
Definition at line 74 of file qtextlayout.h.
QRectF QTextInlineObject::rect | ( | ) | const |
Returns the inline object's rectangle.
Definition at line 163 of file qtextlayout.cpp.
Referenced by addSelectedRegionsToPath().
void QTextInlineObject::setAscent | ( | qreal | a | ) |
Sets the inline object's ascent to a.
Definition at line 225 of file qtextlayout.cpp.
Referenced by QTextDocumentLayout::resizeInlineObject(), and QAbstractTextDocumentLayout::resizeInlineObject().
void QTextInlineObject::setDescent | ( | qreal | d | ) |
Sets the inline object's decent to d.
Definition at line 235 of file qtextlayout.cpp.
Referenced by QTextDocumentLayout::resizeInlineObject(), and QAbstractTextDocumentLayout::resizeInlineObject().
void QTextInlineObject::setWidth | ( | qreal | w | ) |
Sets the inline object's width to w.
Definition at line 215 of file qtextlayout.cpp.
Referenced by QTextDocumentLayout::resizeInlineObject(), and QAbstractTextDocumentLayout::resizeInlineObject().
Qt::LayoutDirection QTextInlineObject::textDirection | ( | ) | const |
Returns if the object should be laid out right-to-left or left-to-right.
Definition at line 270 of file qtextlayout.cpp.
int QTextInlineObject::textPosition | ( | ) | const |
The position of the inline object within the text layout.
Definition at line 243 of file qtextlayout.cpp.
qreal QTextInlineObject::width | ( | ) | const |
Returns the inline object's width.
Definition at line 174 of file qtextlayout.cpp.
Referenced by QTextLine::draw(), QTextLine::naturalTextRect(), and QTextDocumentLayout::positionInlineObject().
|
friend |
Definition at line 94 of file qtextlayout.h.
|
private |
Definition at line 96 of file qtextlayout.h.
Referenced by ascent(), QTextLine::ascent(), QTextLine::cursorToX(), descent(), QTextLine::descent(), QTextLine::draw(), format(), formatIndex(), QTextLine::glyphs(), height(), QTextLine::height(), QTextLine::horizontalAdvance(), QTextLine::layout_helper(), QTextLine::leading(), QTextLine::leadingIncluded(), QTextLine::naturalTextRect(), QTextLine::naturalTextWidth(), QTextLine::position(), rect(), QTextLine::rect(), setAscent(), setDescent(), QTextLine::setLeadingIncluded(), QTextLine::setLineWidth(), QTextLine::setNumColumns(), QTextLine::setPosition(), setWidth(), textDirection(), QTextLine::textLength(), textPosition(), QTextLine::textStart(), width(), QTextLine::width(), QTextLine::x(), QTextLine::xToCursor(), and QTextLine::y().
|
private |
Definition at line 95 of file qtextlayout.h.
Referenced by ascent(), QTextLine::cursorToX(), descent(), QTextLayout::drawCursor(), format(), formatIndex(), height(), rect(), setAscent(), setDescent(), setWidth(), textDirection(), textPosition(), and width().