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.
| 参数: |
|
|---|
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 文本选项。
此枚举包含不同类型的制表符
| 常量 | 描述 |
|---|---|
| QTextOption.LeftTab | 左 Tab |
| QTextOption.RightTab | 右 Tab |
| QTextOption.CenterTab | 居中 Tab |
| QTextOption.DelimiterTab | 停在某个定界符处的 Tab |
| 常量 | 描述 |
|---|---|
| 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). |
此枚举描述文本如何在文档中换行。
| 常量 | 描述 |
|---|---|
| QTextOption.NoWrap | 文本根本不换行。 |
| QTextOption.WordWrap | 文本在单词边界处换行。 |
| QTextOption.ManualWrap | 如同 QTextOption.NoWrap |
| QTextOption.WrapAnywhere | 文本可以在行的任何位置处换行,即使出现在单词中间。 |
| QTextOption.WrapAtWordBoundaryOrAnywhere | 若可能,在单词边界处换行;否则,换行将出现在行的适当位置处,甚至在单词中间。 |
| 返回类型: | PySide.QtCore.Qt.Alignment |
|---|
返回由选项定义的文本对齐方式。
| 返回类型: | PySide.QtGui.QTextOption.Flags |
|---|
返回与选项关联的标志。
| 参数: | alignment – PySide.QtCore.Qt.Alignment |
|---|
| 参数: | flags – PySide.QtGui.QTextOption.Flags |
|---|
| 参数: | tabStops – |
|---|
| 参数: | tabStop – PySide.QtCore.qreal |
|---|
Sets the default distance in device units between tab stops to the value specified by tabStop .
| 参数: | tabStops – |
|---|
| 参数: | aDirection – PySide.QtCore.Qt.LayoutDirection |
|---|
| 参数: | 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).
| 参数: | wrap – PySide.QtGui.QTextOption.WrapMode |
|---|
Sets the option's text wrap mode to the given mode .
| 返回类型: |
|---|
Returns a list of tab positions defined for the text layout.
| 返回类型: | PySide.QtCore.qreal |
|---|
Returns the distance in device units between tab stops. Convenient function for the above method
| 返回类型: |
|---|
Returns a list of tab positions defined for the text layout.
| 返回类型: | PySide.QtCore.Qt.LayoutDirection |
|---|
Returns the direction of the text layout defined by the option.
| 返回类型: | PySide.QtCore.bool |
|---|
Returns true if the layout uses design rather than device metrics; otherwise returns false.
| 返回类型: | PySide.QtGui.QTextOption.WrapMode |
|---|
Returns the text wrap mode defined by the option.