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

    上一话题

    QTextTableFormat

    下一话题

    QTextBlockFormat

    QTextListFormat

    概要

    函数

    详细描述

    PySide.QtGui.QTextListFormat class provides formatting information for lists in a PySide.QtGui.QTextDocument .

    A list is composed of one or more items, represented as text blocks. The list's format specifies the appearance of items in the list. In particular, it determines the indentation and the style of each item.

    The indentation of the items is an integer value that causes each item to be offset from the left margin by a certain amount. This value is read with PySide.QtGui.QTextListFormat.indent() and set with PySide.QtGui.QTextListFormat.setIndent() .

    The style used to decorate each item is set with PySide.QtGui.QTextListFormat.setStyle() and can be read with the PySide.QtGui.QTextListFormat.style() function. The style controls the type of bullet points and numbering scheme used for items in the list. Note that lists that use the decimal numbering scheme begin counting at 1 rather than 0.

    Style properties can be set to further configure the appearance of list items; for example, the ListNumberPrefix and ListNumberSuffix properties can be used to customize the numbers used in an ordered list so that they appear as (1), (2), (3), etc.:

    <Code snippet "doc/src/snippets/textdocument-listitemstyles/mainwindow.cpp:add a styled, ordered list" not found>
    									
    class PySide.QtGui. QTextListFormat
    class PySide.QtGui. QTextListFormat ( fmt )
    class PySide.QtGui. QTextListFormat ( QTextListFormat )
    参数:

    构造新列表格式对象。

    Creates a new list format with the same attributes as the given text format.

    PySide.QtGui.QTextListFormat. Style

    此枚举描述用于装饰列表项的符号:

    常量 描述
    QTextListFormat.ListDisc a filled circle
    QTextListFormat.ListCircle 空心圆
    QTextListFormat.ListSquare 填充正方形
    QTextListFormat.ListDecimal decimal values in ascending order
    QTextListFormat.ListLowerAlpha lower case Latin characters in alphabetical order
    QTextListFormat.ListUpperAlpha upper case Latin characters in alphabetical order
    QTextListFormat.ListLowerRoman lower case roman numerals (supports up to 4999 items only)
    QTextListFormat.ListUpperRoman upper case roman numerals (supports up to 4999 items only)
    PySide.QtGui.QTextListFormat. indent ( )
    返回类型: PySide.QtCore.int

    Returns the list format's indentation. The indentation is multiplied by the QTextDocument.indentWidth property to get the effective indent in pixels.

    PySide.QtGui.QTextListFormat. numberPrefix ( )
    返回类型: unicode

    返回列表格式的数字前缀。

    PySide.QtGui.QTextListFormat. numberSuffix ( )
    返回类型: unicode

    Returns the list format's number suffix.

    PySide.QtGui.QTextListFormat. setIndent ( indent )
    参数: indent PySide.QtCore.int

    Sets the list format's indentation . The indentation is multiplied by the QTextDocument.indentWidth property to get the effective indent in pixels.

    PySide.QtGui.QTextListFormat. setNumberPrefix ( numberPrefix )
    参数: numberPrefix – unicode

    Sets the list format's number prefix to the string specified by numberPrefix . This can be used with all sorted list types. It does not have any effect on unsorted list types.

    The default prefix is an empty string.

    PySide.QtGui.QTextListFormat. setNumberSuffix ( numberSuffix )
    参数: numberSuffix – unicode

    Sets the list format's number suffix to the string specified by numberSuffix . This can be used with all sorted list types. It does not have any effect on unsorted list types.

    The default suffix is ”.”.

    PySide.QtGui.QTextListFormat. setStyle ( style )
    参数: style PySide.QtGui.QTextListFormat.Style

    Sets the list format's style .

    另请参阅

    PySide.QtGui.QTextListFormat.style() QTextListFormat.Style

    PySide.QtGui.QTextListFormat. style ( )
    返回类型: PySide.QtGui.QTextListFormat.Style

    Returns the list format's style.

    另请参阅

    PySide.QtGui.QTextListFormat.setStyle() QTextListFormat.Style