QTextObjectclass is a base class for different kinds of objects that can group parts of aQTextDocument在一起。 更多 …
继承者: QTextBlockGroup , QTextFrame , QTextList , QTextTable
def
document
()
def
format
()
def
formatIndex
()
def
objectIndex
()
def
setFormat
(format)
The common grouping text objects are lists (
QTextList), frames (QTextFrame), and tables (QTextTable). A text object has an associatedformat()anddocument().There are essentially two kinds of text objects: those that are used with blocks (block formats), and those that are used with characters (character formats). The first kind are derived from
QTextBlockGroup, and the second kind fromQTextFrame.You rarely need to use this class directly. When creating custom text objects, you will also need to reimplement
createObject()which acts as a factory method for creating text objects.另请参阅
QTextObject
(
doc
)
¶
- param doc
创建新
QTextObject
为给定
document
.
警告
This function should never be called directly, but only from
createObject()
.
PySide2.QtGui.QTextObject.
document
(
)
¶
Returns the document this object belongs to.
另请参阅
PySide2.QtGui.QTextObject.
format
(
)
¶
Returns the text object’s format.
另请参阅
PySide2.QtGui.QTextObject.
formatIndex
(
)
¶
int
Returns the index of the object’s format in the document’s internal list of formats.
另请参阅
PySide2.QtGui.QTextObject.
objectIndex
(
)
¶
int
Returns the object index of this object. This can be used together with
setObjectIndex()
.
PySide2.QtGui.QTextObject.
setFormat
(
format
)
¶
format
–
QTextFormat
Sets the text object’s
format
.
另请参阅