PySide6.QtGui.QTextFrameFormat¶
- class QTextFrameFormat¶
- The - QTextFrameFormatclass provides formatting information for frames in a- QTextDocument. More…- Inherited by: - QTextTableFormat- Synopsis¶- Methods¶- def - __init__()
- def - border()
- def - borderBrush()
- def - borderStyle()
- def - bottomMargin()
- def - height()
- def - leftMargin()
- def - margin()
- def - padding()
- def - position()
- def - rightMargin()
- def - setBorder()
- def - setBorderBrush()
- def - setBorderStyle()
- def - setHeight()
- def - setLeftMargin()
- def - setMargin()
- def - setPadding()
- def - setPosition()
- def - setRightMargin()
- def - setTopMargin()
- def - setWidth()
- def - topMargin()
- def - width()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- 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 - QTextFrameFormatobject can be determined with the- isValid()function.- See also - class Position¶
- This enum describes how a frame is located relative to the surrounding text. - Constant - Description - QTextFrameFormat.InFlow - QTextFrameFormat.FloatLeft - QTextFrameFormat.FloatRight - See also 
 - class BorderStyle¶
- 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 
 - __init__()¶
 - Constructs a text frame format object with the default properties. - __init__(fmt)
- Parameters:
- fmt – - QTextFormat
 
 - border()¶
- Return type:
- float 
 
 - Returns the width of the border in pixels. - See also - Returns the brush used for the frame’s border. - See also - borderStyle()¶
- Return type:
 
 - Returns the style of the frame’s border. - See also - bottomMargin()¶
- Return type:
- float 
 
 - Returns the width of the frame’s bottom margin in pixels. - See also - height()¶
- Return type:
 
 - Returns the height of the frame’s border rectangle. - See also - leftMargin()¶
- Return type:
- float 
 
 - Returns the width of the frame’s left margin in pixels. - See also - margin()¶
- Return type:
- float 
 
 - Returns the width of the frame’s external margin in pixels. - See also - padding()¶
- Return type:
- float 
 
 - Returns the width of the frame’s internal padding in pixels. - See also - pageBreakPolicy()¶
- Return type:
- Combination of - PageBreakFlag
 
 - Returns the currently set page break policy for the frame/table. The default is - PageBreak_Auto.- See also - Returns the positioning policy for frames with this frame format. - See also - rightMargin()¶
- Return type:
- float 
 
 - Returns the width of the frame’s right margin in pixels. - See also - setBorder(border)¶
- Parameters:
- border – float 
 
 - Sets the - width(in pixels) of the frame’s border.- See also - Sets the - brushused for the frame’s border.- See also - setBorderStyle(style)¶
- Parameters:
- style – - BorderStyle
 
 - Sets the - styleof the frame’s border.- See also - setBottomMargin(margin)¶
- Parameters:
- margin – float 
 
 - Sets the frame’s bottom - marginin pixels.- See also - setHeight(height)¶
- Parameters:
- height – - QTextLength
 
 - Sets the frame’s - height.- See also - setHeight(height)
- Parameters:
- height – float 
 
 - This is an overloaded function. - Sets the frame’s - height.- setLeftMargin(margin)¶
- Parameters:
- margin – float 
 
 - Sets the frame’s left - marginin pixels.- See also - setMargin(margin)¶
- Parameters:
- margin – float 
 
 - Sets the frame’s - marginin 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 - setPadding(padding)¶
- Parameters:
- padding – float 
 
 - Sets the - widthof the frame’s internal padding in pixels.- See also - setPageBreakPolicy(flags)¶
- Parameters:
- flags – Combination of - PageBreakFlag
 
 - Sets the page break policy for the frame/table to - policy.- See also - Sets the - policyfor positioning frames with this frame format.- See also - setRightMargin(margin)¶
- Parameters:
- margin – float 
 
 - Sets the frame’s right - marginin pixels.- See also - setTopMargin(margin)¶
- Parameters:
- margin – float 
 
 - Sets the frame’s top - marginin pixels.- See also - setWidth(length)¶
- Parameters:
- length – - QTextLength
 
 - Sets the frame’s border rectangle’s - width.- See also - setWidth(width)
- Parameters:
- width – 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.- topMargin()¶
- Return type:
- float 
 
 - Returns the width of the frame’s top margin in pixels. - See also - width()¶
- Return type:
 
 - Returns the width of the frame’s border rectangle. - See also