QTextInlineObject — PyQt Documentation v6.9.0 (original) (raw)

PyQt6.QtGui.QTextInlineObject

Description

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

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

Methods

__init__()

TODO


__init__(QTextInlineObject)

TODO


ascent() → float

Returns the inline object’s ascent.


descent() → float

Returns the inline object’s descent.


format() → QTextFormat

Returns format of the inline object within the text layout.


formatIndex() → int

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


height() → float

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

See also

ascent(), descent(), width(), rect().


isValid() → bool

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


rect() → QRectF

Returns the inline object’s rectangle.

See also

ascent(), descent(), width().


setAscent(float)

Sets the inline object’s ascent to a.


setDescent(float)

Sets the inline object’s descent to d.


setWidth(float)

Sets the inline object’s width to w.

See also

width(), ascent(), descent(), rect().


textDirection() → LayoutDirection

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


textPosition() → int

The position of the inline object within the text layout.


width() → float

Returns the inline object’s width.