|  | Home · All Classes · Modules

# QTextInlineObject Class Reference
[QtGui module]

The QTextInlineObject class represents an inline object in a QTextLayout. More...

### Methods

- __init__ (self)
- __init__ (self, QTextInlineObject other)
- float ascent (self)
- float descent (self)
- QTextFormat format (self)
- int formatIndex (self)
- float height (self)
- bool isValid (self)
- QRectF rect (self)
- setAscent (self, float a)
- setDescent (self, float d)
- setWidth (self, float w)
- Qt.LayoutDirection textDirection (self)
- int textPosition (self)
- float width (self)

## Detailed Description

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().

## Method Documentation

### QTextInlineObject.__init__ (self)

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

### QTextInlineObject.__init__ (self, QTextInlineObject other)

### float QTextInlineObject.ascent (self)

Returns the inline object's ascent.

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

### float QTextInlineObject.descent (self)

Returns the inline object's descent.

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

### QTextFormat QTextInlineObject.format (self)

Returns format of the inline object within the text layout.

### int QTextInlineObject.formatIndex (self)

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

### float QTextInlineObject.height (self)

Returns the inline object's total height. This is equal to ascent() + descent() + 1.

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

### bool QTextInlineObject.isValid (self)

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

### QRectF QTextInlineObject.rect (self)

Returns the inline object's rectangle.

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

### QTextInlineObject.setAscent (self, float a)

Sets the inline object's ascent to a.

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

### QTextInlineObject.setDescent (self, float d)

Sets the inline object's decent to d.

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

### QTextInlineObject.setWidth (self, float w)

Sets the inline object's width to w.

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

### Qt.LayoutDirection QTextInlineObject.textDirection (self)

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

### int QTextInlineObject.textPosition (self)

The position of the inline object within the text layout.

### float QTextInlineObject.width (self)

Returns the inline object's width.

See also setWidth(), ascent(), descent(), and rect().