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鈥檚 ascent.

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

float

Returns the inline object鈥檚 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鈥檚 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鈥檚 rectangle.

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

a 鈥� float

Sets the inline object鈥檚 ascent to a .

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

d 鈥� float

Sets the inline object鈥檚 descent to d .

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

w 鈥� float

Sets the inline object鈥檚 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鈥檚 width.