• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QSyntaxHighlighter

    下一话题

    QTextFrame

    QTextObject

    继承者: QTextFrame , QTextTable , QTextBlockGroup , QTextList

    概要

    函数

    详细描述

    PySide.QtGui.QTextObject class is a base class for different kinds of objects that can group parts of a PySide.QtGui.QTextDocument 在一起。

    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.

    另请参阅

    PySide.QtGui.QTextDocument 文本对象范例

    class PySide.QtGui. QTextObject ( doc )
    参数: doc PySide.QtGui.QTextDocument

    创建新 PySide.QtGui.QTextObject 为给定 document .

    警告

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

    PySide.QtGui.QTextObject. document ( )
    返回类型: PySide.QtGui.QTextDocument

    Returns the document this object belongs to.

    PySide.QtGui.QTextObject. format ( )
    返回类型: PySide.QtGui.QTextFormat

    Returns the text object's format.

    PySide.QtGui.QTextObject. formatIndex ( )
    返回类型: PySide.QtCore.int

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

    PySide.QtGui.QTextObject. objectIndex ( )
    返回类型: PySide.QtCore.int

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

    PySide.QtGui.QTextObject. setFormat ( format )
    参数: format PySide.QtGui.QTextFormat

    Sets the text object's format .