QTextFrameFormat Class Reference

[ QtGui module]

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

继承 QTextFormat .

Inherited by QTextTableFormat .

类型

方法


详细描述

The QTextFrameFormat class provides formatting information for frames in a QTextDocument .

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 () 和 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 页面。

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

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


类型文档编制

QTextFrameFormat.BorderStyle

This enum describes different border styles for the text frame.

常量
QTextFrameFormat.BorderStyle_None 0
QTextFrameFormat.BorderStyle_Dotted 1
QTextFrameFormat.BorderStyle_Dashed 2
QTextFrameFormat.BorderStyle_Solid 3
QTextFrameFormat.BorderStyle_Double 4
QTextFrameFormat.BorderStyle_DotDash 5
QTextFrameFormat.BorderStyle_DotDotDash 6
QTextFrameFormat.BorderStyle_Groove 7
QTextFrameFormat.BorderStyle_Ridge 8
QTextFrameFormat.BorderStyle_Inset 9
QTextFrameFormat.BorderStyle_Outset 10

该枚举在 Qt 4.3 引入或被修改。

另请参阅 borderStyle () 和 FrameBorderStyle .

QTextFrameFormat.Position

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

常量
QTextFrameFormat.InFlow 0
QTextFrameFormat.FloatLeft 1
QTextFrameFormat.FloatRight 2

另请参阅 position () 和 CssFloat .


方法文档编制

QTextFrameFormat.__init__ ( self )

Constructs a text frame format object with the default 特性。

QTextFrameFormat.__init__ ( self , QTextFrameFormat )

float QTextFrameFormat.border ( self )

Returns the width of the border in pixels.

另请参阅 setBorder ().

QBrush QTextFrameFormat.borderBrush ( self )

Returns the brush used for the frame's border.

该函数在 Qt 4.3 引入。

另请参阅 setBorderBrush ().

BorderStyle QTextFrameFormat.borderStyle ( self )

Returns the style of the frame's border.

该函数在 Qt 4.3 引入。

另请参阅 setBorderStyle ().

float QTextFrameFormat.bottomMargin ( self )

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

该函数在 Qt 4.3 引入。

另请参阅 setBottomMargin ().

QTextLength QTextFrameFormat.height ( self )

Returns the height of the frame's border rectangle.

另请参阅 setHeight ().

bool QTextFrameFormat.isValid ( self )

Returns true if the format description is valid; otherwise returns false.

float QTextFrameFormat.leftMargin ( self )

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

该函数在 Qt 4.3 引入。

另请参阅 setLeftMargin ().

float QTextFrameFormat.margin ( self )

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

另请参阅 setMargin ().

float QTextFrameFormat.padding ( self )

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

另请参阅 setPadding ().

QTextFormat.PageBreakFlags QTextFrameFormat.pageBreakPolicy ( self )

Returns the currently set page break policy for the frame/table. 默认为 QTextFormat.PageBreak_Auto .

该函数在 Qt 4.2 引入。

另请参阅 setPageBreakPolicy ().

Position QTextFrameFormat.position ( self )

Returns the positioning policy for frames with this frame format.

另请参阅 setPosition ().

float QTextFrameFormat.rightMargin ( self )

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

该函数在 Qt 4.3 引入。

另请参阅 setRightMargin ().

QTextFrameFormat.setBorder ( self , float  aborder )

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

另请参阅 border ().

QTextFrameFormat.setBorderBrush ( self , QBrush   brush )

设置 brush used for the frame's border.

该函数在 Qt 4.3 引入。

另请参阅 borderBrush ().

QTextFrameFormat.setBorderStyle ( self , BorderStyle   style )

设置 style of the frame's border.

该函数在 Qt 4.3 引入。

另请参阅 borderStyle ().

QTextFrameFormat.setBottomMargin ( self , float  amargin )

Sets the frame's bottom margin in pixels.

该函数在 Qt 4.3 引入。

另请参阅 bottomMargin ().

QTextFrameFormat.setHeight ( self , float  aheight )

Sets the frame's height .

另请参阅 height ().

QTextFrameFormat.setHeight ( self , QTextLength   aheight )

这是重载函数。

Sets the frame's height .

QTextFrameFormat.setLeftMargin ( self , float  amargin )

Sets the frame's left margin in pixels.

该函数在 Qt 4.3 引入。

另请参阅 leftMargin ().

QTextFrameFormat.setMargin ( self , float  amargin )

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 ().

QTextFrameFormat.setPadding ( self , float  apadding )

设置 width of the frame's internal padding in 像素。

另请参阅 padding ().

QTextFrameFormat.setPageBreakPolicy ( self , QTextFormat.PageBreakFlags   flags )

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

该函数在 Qt 4.2 引入。

另请参阅 pageBreakPolicy ().

QTextFrameFormat.setPosition ( self , Position   f )

设置 policy for positioning frames with this frame format.

另请参阅 position ().

QTextFrameFormat.setRightMargin ( self , float  amargin )

Sets the frame's right margin in pixels.

该函数在 Qt 4.3 引入。

另请参阅 rightMargin ().

QTextFrameFormat.setTopMargin ( self , float  amargin )

Sets the frame's top margin in pixels.

该函数在 Qt 4.3 引入。

另请参阅 topMargin ().

QTextFrameFormat.setWidth ( self , QTextLength   length )

Sets the frame's border rectangle's width .

另请参阅 width () 和 QTextLength .

QTextFrameFormat.setWidth ( self , float  awidth )

这是重载函数。

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

float QTextFrameFormat.topMargin ( self )

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

该函数在 Qt 4.3 引入。

另请参阅 setTopMargin ().

QTextLength QTextFrameFormat.width ( self )

Returns the width of the frame's border rectangle.

另请参阅 setWidth () 和 QTextLength .