内容表

上一话题

QTextImageFormat

下一话题

QTextItem

QTextInlineObject

QTextInlineObject class represents an inline object in a QAbstractTextDocumentLayout 及其实现。 更多

Inheritance diagram of PySide2.QtGui.QTextInlineObject

概要

详细描述

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() ,和 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 QTextInlineObject
PySide2.QtGui.QTextInlineObject. ascent ( )
返回类型

qreal

Returns the inline object’s ascent.

PySide2.QtGui.QTextInlineObject. descent ( )
返回类型

qreal

Returns the inline object’s descent.

PySide2.QtGui.QTextInlineObject. format ( )
返回类型

QTextFormat

Returns format of the inline object within the text layout.

PySide2.QtGui.QTextInlineObject. formatIndex ( )
返回类型

int

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

PySide2.QtGui.QTextInlineObject. height ( )
返回类型

qreal

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

PySide2.QtGui.QTextInlineObject. isValid ( )
返回类型

bool

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

PySide2.QtGui.QTextInlineObject. rect ( )
返回类型

QRectF

Returns the inline object’s rectangle.

PySide2.QtGui.QTextInlineObject. setAscent ( a )
参数

a qreal

Sets the inline object’s ascent to a .

PySide2.QtGui.QTextInlineObject. setDescent ( d )
参数

d qreal

Sets the inline object’s descent to d .

PySide2.QtGui.QTextInlineObject. setWidth ( w )
参数

w qreal

Sets the inline object’s width to w .

PySide2.QtGui.QTextInlineObject. textDirection ( )
返回类型

LayoutDirection

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

PySide2.QtGui.QTextInlineObject. textPosition ( )
返回类型

int

The position of the inline object within the text layout.

PySide2.QtGui.QTextInlineObject. width ( )
返回类型

qreal

Returns the inline object’s width.