QTextInlineObject

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

Inheritance diagram of PySide2.QtGui.QTextInlineObject

Synopsis

Functions

Detailed Description

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

class PySide2.QtGui.QTextInlineObject
PySide2.QtGui.QTextInlineObject.ascent()
Return type:

float

Returns the inline object’s ascent.

PySide2.QtGui.QTextInlineObject.descent()
Return type:

float

Returns the inline object’s descent.

PySide2.QtGui.QTextInlineObject.format()
Return type:

PySide2.QtGui.QTextFormat

Returns format of the inline object within the text layout.

PySide2.QtGui.QTextInlineObject.formatIndex()
Return type:

int

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

PySide2.QtGui.QTextInlineObject.height()
Return type:

float

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

PySide2.QtGui.QTextInlineObject.isValid()
Return type:

bool

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

PySide2.QtGui.QTextInlineObject.rect()
Return type:

PySide2.QtCore.QRectF

Returns the inline object’s rectangle.

PySide2.QtGui.QTextInlineObject.setAscent(a)
Parameters:

a – float

Sets the inline object’s ascent to a .

PySide2.QtGui.QTextInlineObject.setDescent(d)
Parameters:

d – float

Sets the inline object’s descent to d .

PySide2.QtGui.QTextInlineObject.setWidth(w)
Parameters:

w – float

Sets the inline object’s width to w .

PySide2.QtGui.QTextInlineObject.textDirection()
Return type:

LayoutDirection

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

PySide2.QtGui.QTextInlineObject.textPosition()
Return type:

int

The position of the inline object within the text layout.

PySide2.QtGui.QTextInlineObject.width()
Return type:

float

Returns the inline object’s width.