Table Of Contents

Previous topic

QInputContext

Next topic

QTextFrame

QTextObject

Inheritance diagram of QTextObject

Inherited by: QTextFrame, QTextTable, QTextBlockGroup, QTextList

Synopsis

Functions

Detailed Description

The PySide.QtGui.QTextObject class is a base class for different kinds of objects that can group parts of a PySide.QtGui.QTextDocument together.

The common grouping text objects are lists ( PySide.QtGui.QTextList ), frames ( PySide.QtGui.QTextFrame ), and tables ( PySide.QtGui.QTextTable ). A text object has an associated PySide.QtGui.QTextObject.format() and PySide.QtGui.QTextObject.document() .

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 PySide.QtGui.QTextBlockGroup , and the second kind from PySide.QtGui.QTextFrame .

You rarely need to use this class directly. When creating custom text objects, you will also need to reimplement QTextDocument.createObject() which acts as a factory method for creating text objects.

See also

PySide.QtGui.QTextDocument Text Object Example

class PySide.QtGui.QTextObject(doc)
Parameters:docPySide.QtGui.QTextDocument

Creates a new PySide.QtGui.QTextObject for the given document .

Warning

This function should never be called directly, but only from QTextDocument.createObject() .

PySide.QtGui.QTextObject.document()
Return type:PySide.QtGui.QTextDocument

Returns the document this object belongs to.

PySide.QtGui.QTextObject.format()
Return type:PySide.QtGui.QTextFormat

Returns the text object’s format.

PySide.QtGui.QTextObject.formatIndex()
Return type:PySide.QtCore.int

Returns the index of the object’s format in the document’s internal list of formats.

PySide.QtGui.QTextObject.objectIndex()
Return type:PySide.QtCore.int

Returns the object index of this object. This can be used together with QTextFormat.setObjectIndex() .

PySide.QtGui.QTextObject.setFormat(format)
Parameters:formatPySide.QtGui.QTextFormat

Sets the text object’s format .