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

    上一话题

    QTextLength

    下一话题

    QTextOption.Tab

    QTextOption

    概要

    函数

    详细描述

    PySide.QtGui.QTextOption class provides a description of general rich text properties.

    PySide.QtGui.QTextOption is used to encapsulate common rich text properties in a single object. It contains information about text alignment, layout direction, word wrapping, and other standard properties associated with text rendering and layout.

    class PySide.QtGui. QTextOption
    class PySide.QtGui. QTextOption ( alignment )
    class PySide.QtGui. QTextOption ( o )
    参数:

    Constructs a text option with default properties for text. The text alignment property is set to Qt.AlignLeft . The word wrap property is set to QTextOption.WordWrap 。设计指标所用标志被设为 false。

    构造副本为 other 文本选项。

    PySide.QtGui.QTextOption. TabType

    此枚举包含不同类型的制表符

    常量 描述
    QTextOption.LeftTab 左 Tab
    QTextOption.RightTab 右 Tab
    QTextOption.CenterTab 居中 Tab
    QTextOption.DelimiterTab 停在某个定界符处的 Tab
    PySide.QtGui.QTextOption. Flag
    常量 描述
    QTextOption.IncludeTrailingSpaces When this option is set, QTextLine.naturalTextWidth() and naturalTextRect() will return a value that includes the width of trailing spaces in the text; otherwise this width is excluded.
    QTextOption.ShowTabsAndSpaces Visualize spaces with little dots, and tabs with little arrows.
    QTextOption.ShowLineAndParagraphSeparators Visualize line and paragraph separators with appropriate symbol characters.
    QTextOption.AddSpaceForLineAndParagraphSeparators While determining the line-break positions take into account the space added for drawing a separator character.
    QTextOption.SuppressColors Suppress all color changes in the character formats (except the main selection).
    PySide.QtGui.QTextOption. WrapMode

    此枚举描述文本如何在文档中换行。

    常量 描述
    QTextOption.NoWrap 文本根本不换行。
    QTextOption.WordWrap 文本在单词边界处换行。
    QTextOption.ManualWrap 如同 QTextOption.NoWrap
    QTextOption.WrapAnywhere 文本可以在行的任何位置处换行,即使出现在单词中间。
    QTextOption.WrapAtWordBoundaryOrAnywhere 若可能,在单词边界处换行;否则,换行将出现在行的适当位置处,甚至在单词中间。
    PySide.QtGui.QTextOption. alignment ( )
    返回类型: PySide.QtCore.Qt.Alignment

    返回由选项定义的文本对齐方式。

    PySide.QtGui.QTextOption. flags ( )
    返回类型: PySide.QtGui.QTextOption.Flags

    返回与选项关联的标志。

    PySide.QtGui.QTextOption. setAlignment ( alignment )
    参数: alignment PySide.QtCore.Qt.Alignment
    PySide.QtGui.QTextOption. setFlags ( flags )
    参数: flags PySide.QtGui.QTextOption.Flags
    PySide.QtGui.QTextOption. setTabArray ( tabStops )
    参数: tabStops
    PySide.QtGui.QTextOption. setTabStop ( tabStop )
    参数: tabStop PySide.QtCore.qreal

    Sets the default distance in device units between tab stops to the value specified by tabStop .

    PySide.QtGui.QTextOption. setTabs ( tabStops )
    参数: tabStops
    PySide.QtGui.QTextOption. setTextDirection ( aDirection )
    参数: aDirection PySide.QtCore.Qt.LayoutDirection
    PySide.QtGui.QTextOption. setUseDesignMetrics ( b )
    参数: b PySide.QtCore.bool

    enable is true then the layout will use design metrics; otherwise it will use the metrics of the paint device (which is the default behavior).

    PySide.QtGui.QTextOption. setWrapMode ( wrap )
    参数: wrap PySide.QtGui.QTextOption.WrapMode

    Sets the option's text wrap mode to the given mode .

    PySide.QtGui.QTextOption. tabArray ( )
    返回类型:

    Returns a list of tab positions defined for the text layout.

    PySide.QtGui.QTextOption. tabStop ( )
    返回类型: PySide.QtCore.qreal

    Returns the distance in device units between tab stops. Convenient function for the above method

    PySide.QtGui.QTextOption. tabs ( )
    返回类型:

    Returns a list of tab positions defined for the text layout.

    PySide.QtGui.QTextOption. textDirection ( )
    返回类型: PySide.QtCore.Qt.LayoutDirection

    Returns the direction of the text layout defined by the option.

    PySide.QtGui.QTextOption. useDesignMetrics ( )
    返回类型: PySide.QtCore.bool

    Returns true if the layout uses design rather than device metrics; otherwise returns false.

    PySide.QtGui.QTextOption. wrapMode ( )
    返回类型: PySide.QtGui.QTextOption.WrapMode

    Returns the text wrap mode defined by the option.