QTextFrameFormat¶
The
QTextFrameFormat
class provides formatting information for frames in aQTextDocument
. More…
Inherited by: QTextTableFormat
Synopsis¶
Functions¶
def
border
()def
borderBrush
()def
borderStyle
()def
bottomMargin
()def
height
()def
leftMargin
()def
margin
()def
padding
()def
pageBreakPolicy
()def
position
()def
rightMargin
()def
setBorder
(border)def
setBorderBrush
(brush)def
setBorderStyle
(style)def
setBottomMargin
(margin)def
setHeight
(height)def
setHeight
(height)def
setLeftMargin
(margin)def
setMargin
(margin)def
setPadding
(padding)def
setPageBreakPolicy
(flags)def
setPosition
(f)def
setRightMargin
(margin)def
setTopMargin
(margin)def
setWidth
(length)def
setWidth
(width)def
topMargin
()def
width
()
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()
andheight()
of the frame on the screen. Each frame can have aborder()
that surrounds its contents with a rectangular box. The border is surrounded by amargin()
around the frame, and the contents of the frame are kept separate from the border by the frame’spadding()
. This scheme is similar to the box model used by Cascading Style Sheets for HTML pages.The
position()
of a frame is set usingsetPosition()
and determines how it is located relative to the surrounding text.The validity of a
QTextFrameFormat
object can be determined with theisValid()
function.See also
- class PySide2.QtGui.QTextFrameFormat¶
PySide2.QtGui.QTextFrameFormat(fmt)
PySide2.QtGui.QTextFrameFormat(QTextFrameFormat)
- param fmt:
- param 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.
Constant
Description
QTextFrameFormat.InFlow
QTextFrameFormat.FloatLeft
QTextFrameFormat.FloatRight
See also
position()
CssFloat
- PySide2.QtGui.QTextFrameFormat.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
borderStyle()
FrameBorderStyle
- PySide2.QtGui.QTextFrameFormat.border()¶
- Return type:
float
Returns the width of the border in pixels.
See also
- PySide2.QtGui.QTextFrameFormat.borderBrush()¶
- Return type:
Returns the brush used for the frame’s border.
See also
- PySide2.QtGui.QTextFrameFormat.borderStyle()¶
- Return type:
Returns the style of the frame’s border.
See also
- PySide2.QtGui.QTextFrameFormat.bottomMargin()¶
- Return type:
float
Returns the width of the frame’s bottom margin in pixels.
See also
- PySide2.QtGui.QTextFrameFormat.height()¶
- Return type:
Returns the height of the frame’s border rectangle.
See also
- PySide2.QtGui.QTextFrameFormat.leftMargin()¶
- Return type:
float
Returns the width of the frame’s left margin in pixels.
See also
- PySide2.QtGui.QTextFrameFormat.margin()¶
- Return type:
float
Returns the width of the frame’s external margin in pixels.
See also
- PySide2.QtGui.QTextFrameFormat.padding()¶
- Return type:
float
Returns the width of the frame’s internal padding in pixels.
See also
- PySide2.QtGui.QTextFrameFormat.pageBreakPolicy()¶
- Return type:
PageBreakFlags
Returns the currently set page break policy for the frame/table. The default is
PageBreak_Auto
.See also
- PySide2.QtGui.QTextFrameFormat.position()¶
- Return type:
Returns the positioning policy for frames with this frame format.
See also
- PySide2.QtGui.QTextFrameFormat.rightMargin()¶
- Return type:
float
Returns the width of the frame’s right margin in pixels.
See also
- PySide2.QtGui.QTextFrameFormat.setBorder(border)¶
- Parameters:
border – float
Sets the
width
(in pixels) of the frame’s border.See also
- PySide2.QtGui.QTextFrameFormat.setBorderBrush(brush)¶
- Parameters:
brush –
PySide2.QtGui.QBrush
Sets the
brush
used for the frame’s border.See also
- PySide2.QtGui.QTextFrameFormat.setBorderStyle(style)¶
- Parameters:
style –
BorderStyle
Sets the
style
of the frame’s border.See also
- PySide2.QtGui.QTextFrameFormat.setBottomMargin(margin)¶
- Parameters:
margin – float
Sets the frame’s bottom
margin
in pixels.See also
- PySide2.QtGui.QTextFrameFormat.setHeight(height)¶
- Parameters:
height –
PySide2.QtGui.QTextLength
- PySide2.QtGui.QTextFrameFormat.setHeight(height)
- Parameters:
height – float
This is an overloaded function.
Sets the frame’s
height
.
- PySide2.QtGui.QTextFrameFormat.setLeftMargin(margin)¶
- Parameters:
margin – float
Sets the frame’s left
margin
in pixels.See also
- PySide2.QtGui.QTextFrameFormat.setMargin(margin)¶
- Parameters:
margin – 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
- PySide2.QtGui.QTextFrameFormat.setPadding(padding)¶
- Parameters:
padding – float
Sets the
width
of the frame’s internal padding in pixels.See also
- PySide2.QtGui.QTextFrameFormat.setPageBreakPolicy(flags)¶
- Parameters:
flags –
PageBreakFlags
Sets the page break policy for the frame/table to
policy
.See also
- PySide2.QtGui.QTextFrameFormat.setPosition(f)¶
- Parameters:
f –
Position
Sets the
policy
for positioning frames with this frame format.See also
- PySide2.QtGui.QTextFrameFormat.setRightMargin(margin)¶
- Parameters:
margin – float
Sets the frame’s right
margin
in pixels.See also
- PySide2.QtGui.QTextFrameFormat.setTopMargin(margin)¶
- Parameters:
margin – float
Sets the frame’s top
margin
in pixels.See also
- PySide2.QtGui.QTextFrameFormat.setWidth(length)¶
- Parameters:
length –
PySide2.QtGui.QTextLength
- PySide2.QtGui.QTextFrameFormat.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
.
- PySide2.QtGui.QTextFrameFormat.topMargin()¶
- Return type:
float
Returns the width of the frame’s top margin in pixels.
See also
- PySide2.QtGui.QTextFrameFormat.width()¶
- Return type:
Returns the width of the frame’s border rectangle.
See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.