QTextFrameFormatclass provides formatting information for frames in aQTextDocument. 更多 …
继承者: QTextTableFormat
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
()
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.![]()
position()of a frame is set usingsetPosition()and determines how it is located relative to the surrounding text.The validity of a
QTextFrameFormatobject can be determined with theisValid()函数。
QTextFrameFormat
¶
QTextFrameFormat(fmt)
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.
|
常量 |
描述 |
|---|---|
|
QTextFrameFormat.InFlow |
|
|
QTextFrameFormat.FloatLeft |
|
|
QTextFrameFormat.FloatRight |
另请参阅
position()
CssFloat
PySide2.QtGui.QTextFrameFormat.
BorderStyle
¶
This enum describes different border styles for the text frame.
|
常量 |
描述 |
|---|---|
|
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 |
另请参阅
borderStyle()
FrameBorderStyle
PySide2.QtGui.QTextFrameFormat.
border
(
)
¶
qreal
Returns the width of the border in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
borderBrush
(
)
¶
Returns the brush used for the frame’s border.
另请参阅
PySide2.QtGui.QTextFrameFormat.
borderStyle
(
)
¶
Returns the style of the frame’s border.
另请参阅
PySide2.QtGui.QTextFrameFormat.
bottomMargin
(
)
¶
qreal
Returns the width of the frame’s bottom margin in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
height
(
)
¶
Returns the height of the frame’s border rectangle.
另请参阅
PySide2.QtGui.QTextFrameFormat.
leftMargin
(
)
¶
qreal
Returns the width of the frame’s left margin in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
margin
(
)
¶
qreal
Returns the width of the frame’s external margin in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
padding
(
)
¶
qreal
Returns the width of the frame’s internal padding in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
pageBreakPolicy
(
)
¶
PageBreakFlags
Returns the currently set page break policy for the frame/table. The default is
PageBreak_Auto
.
另请参阅
PySide2.QtGui.QTextFrameFormat.
position
(
)
¶
Returns the positioning policy for frames with this frame format.
另请参阅
PySide2.QtGui.QTextFrameFormat.
rightMargin
(
)
¶
qreal
Returns the width of the frame’s right margin in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setBorder
(
border
)
¶
border
–
qreal
设置
width
(in pixels) of the frame’s border.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setBorderBrush
(
brush
)
¶
brush
–
QBrush
设置
brush
used for the frame’s border.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setBorderStyle
(
style
)
¶
style
–
BorderStyle
设置
style
of the frame’s border.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setBottomMargin
(
margin
)
¶
margin
–
qreal
Sets the frame’s bottom
margin
in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setHeight
(
height
)
¶
height
–
QTextLength
PySide2.QtGui.QTextFrameFormat.
setHeight
(
height
)
¶
height
–
qreal
这是重载函数。
Sets the frame’s
height
.
PySide2.QtGui.QTextFrameFormat.
setLeftMargin
(
margin
)
¶
margin
–
qreal
Sets the frame’s left
margin
in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setMargin
(
margin
)
¶
margin
–
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.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setPadding
(
padding
)
¶
padding
–
qreal
设置
width
of the frame’s internal padding in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setPageBreakPolicy
(
flags
)
¶
flags
–
PageBreakFlags
Sets the page break policy for the frame/table to
policy
.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setPosition
(
f
)
¶
f
–
Position
设置
policy
for positioning frames with this frame format.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setRightMargin
(
margin
)
¶
margin
–
qreal
Sets the frame’s right
margin
in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setTopMargin
(
margin
)
¶
margin
–
qreal
Sets the frame’s top
margin
in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
setWidth
(
length
)
¶
length
–
QTextLength
PySide2.QtGui.QTextFrameFormat.
setWidth
(
width
)
¶
width
–
qreal
这是重载函数。
Convenience method that sets the width of the frame’s border rectangle’s width to the specified fixed
width
.
PySide2.QtGui.QTextFrameFormat.
topMargin
(
)
¶
qreal
Returns the width of the frame’s top margin in pixels.
另请参阅
PySide2.QtGui.QTextFrameFormat.
width
(
)
¶
Returns the width of the frame’s border rectangle.
另请参阅