Home · All Classes · Modules

QTextFrameFormat Class Reference
[QtGui module]

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

Inherits QTextFormat.

Inherited by QTextTableFormat.

Types

Methods


Detailed Description

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

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

See also QTextFrame and QTextBlockFormat.


Type Documentation

QTextFrameFormat.BorderStyle

This enum describes different border styles for the text frame.

ConstantValue
QTextFrameFormat.BorderStyle_None0
QTextFrameFormat.BorderStyle_Dotted1
QTextFrameFormat.BorderStyle_Dashed2
QTextFrameFormat.BorderStyle_Solid3
QTextFrameFormat.BorderStyle_Double4
QTextFrameFormat.BorderStyle_DotDash5
QTextFrameFormat.BorderStyle_DotDotDash6
QTextFrameFormat.BorderStyle_Groove7
QTextFrameFormat.BorderStyle_Ridge8
QTextFrameFormat.BorderStyle_Inset9
QTextFrameFormat.BorderStyle_Outset10

This enum was introduced in Qt 4.3.

See also borderStyle() and FrameBorderStyle.

QTextFrameFormat.Position

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

ConstantValue
QTextFrameFormat.InFlow0
QTextFrameFormat.FloatLeft1
QTextFrameFormat.FloatRight2

See also position() and CssFloat.


Method Documentation

QTextFrameFormat.__init__ (self)

Constructs a text frame format object with the default properties.

QTextFrameFormat.__init__ (self, QTextFrameFormat)

float QTextFrameFormat.border (self)

Returns the width of the border in pixels.

See also setBorder().

QBrush QTextFrameFormat.borderBrush (self)

Returns the brush used for the frame's border.

This function was introduced in Qt 4.3.

See also setBorderBrush().

BorderStyle QTextFrameFormat.borderStyle (self)

Returns the style of the frame's border.

This function was introduced in Qt 4.3.

See also setBorderStyle().

float QTextFrameFormat.bottomMargin (self)

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

This function was introduced in Qt 4.3.

See also setBottomMargin().

QTextLength QTextFrameFormat.height (self)

Returns the height of the frame's border rectangle.

See also 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.

This function was introduced in Qt 4.3.

See also setLeftMargin().

float QTextFrameFormat.margin (self)

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

See also setMargin().

float QTextFrameFormat.padding (self)

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

See also setPadding().

QTextFormat.PageBreakFlags QTextFrameFormat.pageBreakPolicy (self)

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

This function was introduced in Qt 4.2.

See also setPageBreakPolicy().

Position QTextFrameFormat.position (self)

Returns the positioning policy for frames with this frame format.

See also setPosition().

float QTextFrameFormat.rightMargin (self)

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

This function was introduced in Qt 4.3.

See also setRightMargin().

QTextFrameFormat.setBorder (self, float)

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

See also border().

QTextFrameFormat.setBorderBrush (self, QBrush)

Sets the brush used for the frame's border.

This function was introduced in Qt 4.3.

See also borderBrush().

QTextFrameFormat.setBorderStyle (self, BorderStyle)

Sets the style of the frame's border.

This function was introduced in Qt 4.3.

See also borderStyle().

QTextFrameFormat.setBottomMargin (self, float)

Sets the frame's bottom margin in pixels.

This function was introduced in Qt 4.3.

See also bottomMargin().

QTextFrameFormat.setHeight (self, float)

Sets the frame's height.

See also height().

QTextFrameFormat.setHeight (self, QTextLength)

This is an overloaded function.

Sets the frame's height.

QTextFrameFormat.setLeftMargin (self, float)

Sets the frame's left margin in pixels.

This function was introduced in Qt 4.3.

See also leftMargin().

QTextFrameFormat.setMargin (self, float)

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.

See also margin().

QTextFrameFormat.setPadding (self, float)

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

See also padding().

QTextFrameFormat.setPageBreakPolicy (self, QTextFormat.PageBreakFlags)

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

This function was introduced in Qt 4.2.

See also pageBreakPolicy().

QTextFrameFormat.setPosition (self, Position)

Sets the policy for positioning frames with this frame format.

See also position().

QTextFrameFormat.setRightMargin (self, float)

Sets the frame's right margin in pixels.

This function was introduced in Qt 4.3.

See also rightMargin().

QTextFrameFormat.setTopMargin (self, float)

Sets the frame's top margin in pixels.

This function was introduced in Qt 4.3.

See also topMargin().

QTextFrameFormat.setWidth (self, QTextLength)

Sets the frame's border rectangle's width.

See also width() and QTextLength.

QTextFrameFormat.setWidth (self, float)

This is an overloaded function.

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.

This function was introduced in Qt 4.3.

See also setTopMargin().

QTextLength QTextFrameFormat.width (self)

Returns the width of the frame's border rectangle.

See also setWidth() and QTextLength.


PyQt 4.7.3 for X11Copyright © Riverbank Computing Ltd and Nokia 2010Qt 4.6.2