内容表

上一话题

QTextFrame

下一话题

QTextImageFormat

QTextFrameFormat

QTextFrameFormat class provides formatting information for frames in a QTextDocument . 更多

Inheritance diagram of PySide2.QtGui.QTextFrameFormat

继承者: QTextTableFormat

概要

函数

详细描述

A text frame groups together one or more blocks of text, providing a layer of structure larger than the paragraph. The format of a frame specifies how it is rendered and positioned on the screen. It does not directly specify the behavior of the text formatting within, but provides constraints on the layout of its children.

The frame format defines the width() and height() of the frame on the screen. Each frame can have a border() that surrounds its contents with a rectangular box. The border is surrounded by a margin() around the frame, and the contents of the frame are kept separate from the border by the frame’s padding() . This scheme is similar to the box model used by Cascading Style Sheets for HTML pages.

../../_images/qtextframe-style.png

position() of a frame is set using setPosition() and determines how it is located relative to the surrounding text.

The validity of a QTextFrameFormat object can be determined with the isValid() 函数。

class QTextFrameFormat

QTextFrameFormat(fmt)

QTextFrameFormat(QTextFrameFormat)

param fmt

QTextFormat

param QTextFrameFormat

QTextFrameFormat

Constructs a text frame format object with the default properties.

PySide2.QtGui.QTextFrameFormat. Position

This enum describes how a frame is located relative to the surrounding text.

常量

描述

QTextFrameFormat.InFlow

QTextFrameFormat.FloatLeft

QTextFrameFormat.FloatRight

另请参阅

position() CssFloat

PySide2.QtGui.QTextFrameFormat. BorderStyle

This enum describes different border styles for the text frame.

常量

描述

QTextFrameFormat.BorderStyle_None

QTextFrameFormat.BorderStyle_Dotted

QTextFrameFormat.BorderStyle_Dashed

QTextFrameFormat.BorderStyle_Solid

QTextFrameFormat.BorderStyle_Double

QTextFrameFormat.BorderStyle_DotDash

QTextFrameFormat.BorderStyle_DotDotDash

QTextFrameFormat.BorderStyle_Groove

QTextFrameFormat.BorderStyle_Ridge

QTextFrameFormat.BorderStyle_Inset

QTextFrameFormat.BorderStyle_Outset

另请参阅

borderStyle() FrameBorderStyle

PySide2.QtGui.QTextFrameFormat. border ( )
返回类型

qreal

Returns the width of the border in pixels.

另请参阅

setBorder()

PySide2.QtGui.QTextFrameFormat. borderBrush ( )
返回类型

QBrush

Returns the brush used for the frame’s border.

另请参阅

setBorderBrush()

PySide2.QtGui.QTextFrameFormat. borderStyle ( )
返回类型

BorderStyle

Returns the style of the frame’s border.

另请参阅

setBorderStyle()

PySide2.QtGui.QTextFrameFormat. bottomMargin ( )
返回类型

qreal

Returns the width of the frame’s bottom margin in pixels.

另请参阅

setBottomMargin()

PySide2.QtGui.QTextFrameFormat. height ( )
返回类型

QTextLength

Returns the height of the frame’s border rectangle.

另请参阅

setHeight()

PySide2.QtGui.QTextFrameFormat. leftMargin ( )
返回类型

qreal

Returns the width of the frame’s left margin in pixels.

另请参阅

setLeftMargin()

PySide2.QtGui.QTextFrameFormat. margin ( )
返回类型

qreal

Returns the width of the frame’s external margin in pixels.

另请参阅

setMargin()

PySide2.QtGui.QTextFrameFormat. padding ( )
返回类型

qreal

Returns the width of the frame’s internal padding in pixels.

另请参阅

setPadding()

PySide2.QtGui.QTextFrameFormat. pageBreakPolicy ( )
返回类型

PageBreakFlags

Returns the currently set page break policy for the frame/table. The default is PageBreak_Auto .

PySide2.QtGui.QTextFrameFormat. position ( )
返回类型

Position

Returns the positioning policy for frames with this frame format.

另请参阅

setPosition()

PySide2.QtGui.QTextFrameFormat. rightMargin ( )
返回类型

qreal

Returns the width of the frame’s right margin in pixels.

另请参阅

setRightMargin()

PySide2.QtGui.QTextFrameFormat. setBorder ( border )
参数

border qreal

设置 width (in pixels) of the frame’s border.

另请参阅

border()

PySide2.QtGui.QTextFrameFormat. setBorderBrush ( brush )
参数

brush QBrush

设置 brush used for the frame’s border.

另请参阅

borderBrush()

PySide2.QtGui.QTextFrameFormat. setBorderStyle ( style )
参数

style BorderStyle

设置 style of the frame’s border.

另请参阅

borderStyle()

PySide2.QtGui.QTextFrameFormat. setBottomMargin ( margin )
参数

margin qreal

Sets the frame’s bottom margin in pixels.

另请参阅

bottomMargin()

PySide2.QtGui.QTextFrameFormat. setHeight ( height )
参数

height QTextLength

PySide2.QtGui.QTextFrameFormat. setHeight ( height )
参数

height qreal

这是重载函数。

Sets the frame’s height .

PySide2.QtGui.QTextFrameFormat. setLeftMargin ( margin )
参数

margin qreal

Sets the frame’s left margin in pixels.

另请参阅

leftMargin()

PySide2.QtGui.QTextFrameFormat. setMargin ( margin )
参数

margin qreal

Sets the frame’s margin in pixels. This method also sets the left, right, top and bottom margins of the frame to the same value. The individual margins override the general margin.

另请参阅

margin()

PySide2.QtGui.QTextFrameFormat. setPadding ( padding )
参数

padding qreal

设置 width of the frame’s internal padding in pixels.

另请参阅

padding()

PySide2.QtGui.QTextFrameFormat. setPageBreakPolicy ( flags )
参数

flags PageBreakFlags

Sets the page break policy for the frame/table to policy .

另请参阅

pageBreakPolicy()

PySide2.QtGui.QTextFrameFormat. setPosition ( f )
参数

f Position

设置 policy for positioning frames with this frame format.

另请参阅

position()

PySide2.QtGui.QTextFrameFormat. setRightMargin ( margin )
参数

margin qreal

Sets the frame’s right margin in pixels.

另请参阅

rightMargin()

PySide2.QtGui.QTextFrameFormat. setTopMargin ( margin )
参数

margin qreal

Sets the frame’s top margin in pixels.

另请参阅

topMargin()

PySide2.QtGui.QTextFrameFormat. setWidth ( length )
参数

length QTextLength

PySide2.QtGui.QTextFrameFormat. setWidth ( width )
参数

width qreal

这是重载函数。

Convenience method that sets the width of the frame’s border rectangle’s width to the specified fixed width .

PySide2.QtGui.QTextFrameFormat. topMargin ( )
返回类型

qreal

Returns the width of the frame’s top margin in pixels.

另请参阅

setTopMargin()

PySide2.QtGui.QTextFrameFormat. width ( )
返回类型

QTextLength

Returns the width of the frame’s border rectangle.