Inherited by: QTextTableFormat
The PySide.QtGui.QTextFrameFormat class provides formatting information for frames in a PySide.QtGui.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 PySide.QtGui.QTextFrameFormat.width() and PySide.QtGui.QTextFrameFormat.height() of the frame on the screen. Each frame can have a PySide.QtGui.QTextFrameFormat.border() that surrounds its contents with a rectangular box. The border is surrounded by a PySide.QtGui.QTextFrameFormat.margin() around the frame, and the contents of the frame are kept separate from the border by the frame’s PySide.QtGui.QTextFrameFormat.padding() . This scheme is similar to the box model used by Cascading Style Sheets for HTML pages.
The PySide.QtGui.QTextFrameFormat.position() of a frame is set using PySide.QtGui.QTextFrameFormat.setPosition() and determines how it is located relative to the surrounding text.
The validity of a PySide.QtGui.QTextFrameFormat object can be determined with the PySide.QtGui.QTextFrameFormat.isValid() function.
Parameters: |
|
---|
Constructs a text frame format object with the default properties.
Creates a new frame format with the same attributes as the given text format.
This enum describes how a frame is located relative to the surrounding text.
Constant | Description |
---|---|
QTextFrameFormat.InFlow | |
QTextFrameFormat.FloatLeft | |
QTextFrameFormat.FloatRight |
See also
This enum describes different border styles for the text frame.
Constant | Description |
---|---|
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 |
See also
PySide.QtGui.QTextFrameFormat.borderStyle() FrameBorderStyle
Return type: | PySide.QtCore.qreal |
---|
Returns the width of the border in pixels.
Return type: | PySide.QtGui.QBrush |
---|
Returns the brush used for the frame’s border.
Return type: | PySide.QtGui.QTextFrameFormat.BorderStyle |
---|
Returns the style of the frame’s border.
Return type: | PySide.QtCore.qreal |
---|
Returns the width of the frame’s bottom margin in pixels.
Return type: | PySide.QtGui.QTextLength |
---|
Returns the height of the frame’s border rectangle.
Return type: | PySide.QtCore.qreal |
---|
Returns the width of the frame’s left margin in pixels.
Return type: | PySide.QtCore.qreal |
---|
Returns the width of the frame’s external margin in pixels.
Return type: | PySide.QtCore.qreal |
---|
Returns the width of the frame’s internal padding in pixels.
Return type: | PySide.QtGui.QTextFormat.PageBreakFlags |
---|
Returns the currently set page break policy for the frame/table. The default is QTextFormat.PageBreak_Auto .
Return type: | PySide.QtGui.QTextFrameFormat.Position |
---|
Returns the positioning policy for frames with this frame format.
Return type: | PySide.QtCore.qreal |
---|
Returns the width of the frame’s right margin in pixels.
Parameters: | border – PySide.QtCore.qreal |
---|
Sets the width (in pixels) of the frame’s border.
Parameters: | brush – PySide.QtGui.QBrush |
---|
Sets the brush used for the frame’s border.
Parameters: | style – PySide.QtGui.QTextFrameFormat.BorderStyle |
---|
Sets the style of the frame’s border.
Parameters: | margin – PySide.QtCore.qreal |
---|
Sets the frame’s bottom margin in pixels.
Parameters: | height – PySide.QtGui.QTextLength |
---|
Sets the frame’s height .
Parameters: | height – PySide.QtCore.qreal |
---|
This is an overloaded function.
Sets the frame’s height .
Parameters: | margin – PySide.QtCore.qreal |
---|
Sets the frame’s left margin in pixels.
Parameters: | margin – PySide.QtCore.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.
Parameters: | padding – PySide.QtCore.qreal |
---|
Sets the width of the frame’s internal padding in pixels.
Parameters: | flags – PySide.QtGui.QTextFormat.PageBreakFlags |
---|
Parameters: | f – PySide.QtGui.QTextFrameFormat.Position |
---|
Sets the policy for positioning frames with this frame format.
Parameters: | margin – PySide.QtCore.qreal |
---|
Sets the frame’s right margin in pixels.
Parameters: | margin – PySide.QtCore.qreal |
---|
Sets the frame’s top margin in pixels.
Parameters: | width – PySide.QtCore.qreal |
---|
This is an overloaded function.
Convenience method that sets the width of the frame’s border rectangle’s width to the specified fixed width .
Parameters: | length – PySide.QtGui.QTextLength |
---|
Sets the frame’s border rectangle’s width .
Return type: | PySide.QtCore.qreal |
---|
Returns the width of the frame’s top margin in pixels.
Return type: | PySide.QtGui.QTextLength |
---|
Returns the width of the frame’s border rectangle.