QTextObject¶
The
QTextObject
class is a base class for different kinds of objects that can group parts of aQTextDocument
together. More…
Inherited by: QTextBlockGroup, QTextFrame, QTextList, QTextTable
Synopsis¶
Functions¶
def
document
()def
format
()def
formatIndex
()def
objectIndex
()def
setFormat
(format)
Detailed Description¶
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.See also
- class PySide2.QtGui.QTextObject(doc)¶
- param doc:
Creates a new
QTextObject
for the givendocument
.Warning
This function should never be called directly, but only from
createObject()
.
- PySide2.QtGui.QTextObject.document()¶
- Return type:
Returns the document this object belongs to.
See also
- PySide2.QtGui.QTextObject.format()¶
- Return type:
Returns the text object’s format.
See also
- PySide2.QtGui.QTextObject.formatIndex()¶
- Return type:
int
Returns the index of the object’s format in the document’s internal list of formats.
See also
- PySide2.QtGui.QTextObject.objectIndex()¶
- Return type:
int
Returns the object index of this object. This can be used together with
setObjectIndex()
.
- PySide2.QtGui.QTextObject.setFormat(format)¶
- Parameters:
format –
PySide2.QtGui.QTextFormat
Sets the text object’s
format
.See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.