The QTextFrameFormat class provides formatting information for frames in a QTextDocument . 更多...
| 頭: | #include <QTextFrameFormat> |
| qmake: | QT += gui |
| 繼承: | QTextFormat |
| 繼承者: | QTextTableFormat |
注意: 此類的所有函數 可重入 .
| enum | BorderStyle { BorderStyle_None, BorderStyle_Dotted, BorderStyle_Dashed, BorderStyle_Solid, ..., BorderStyle_Outset } |
| enum | Position { InFlow, FloatLeft, FloatRight } |
| QTextFrameFormat () | |
| qreal | border () const |
| QBrush | borderBrush () const |
| QTextFrameFormat::BorderStyle | borderStyle () const |
| qreal | bottomMargin () const |
| QTextLength | height () const |
| bool | isValid () const |
| qreal | leftMargin () const |
| qreal | margin () const |
| qreal | padding () const |
| QTextFormat::PageBreakFlags | pageBreakPolicy () const |
| QTextFrameFormat::Position | position () const |
| qreal | rightMargin () const |
| void | setBorder (qreal width ) |
| void | setBorderBrush (const QBrush & brush ) |
| void | setBorderStyle (QTextFrameFormat::BorderStyle style ) |
| void | setBottomMargin (qreal margin ) |
| void | setHeight (const QTextLength & height ) |
| void | setHeight (qreal height ) |
| void | setLeftMargin (qreal margin ) |
| void | setMargin (qreal margin ) |
| void | setPadding (qreal width ) |
| void | setPageBreakPolicy (QTextFormat::PageBreakFlags policy ) |
| void | setPosition (QTextFrameFormat::Position policy ) |
| void | setRightMargin (qreal margin ) |
| void | setTopMargin (qreal margin ) |
| void | setWidth (const QTextLength & width ) |
| void | setWidth (qreal width ) |
| qreal | topMargin () const |
| QTextLength | width () const |
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 () 和 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 () 函數。
另請參閱 QTextFrame and QTextBlockFormat .
This enum describes different border styles for the text frame.
| 常量 | 值 |
|---|---|
QTextFrameFormat::BorderStyle_None
|
0
|
QTextFrameFormat::BorderStyle_Dotted
|
1
|
QTextFrameFormat::BorderStyle_Dashed
|
2
|
QTextFrameFormat::BorderStyle_Solid
|
3
|
QTextFrameFormat::BorderStyle_Double
|
4
|
QTextFrameFormat::BorderStyle_DotDash
|
5
|
QTextFrameFormat::BorderStyle_DotDotDash
|
6
|
QTextFrameFormat::BorderStyle_Groove
|
7
|
QTextFrameFormat::BorderStyle_Ridge
|
8
|
QTextFrameFormat::BorderStyle_Inset
|
9
|
QTextFrameFormat::BorderStyle_Outset
|
10
|
該枚舉在 Qt 4.3 引入或被修改。
另請參閱 borderStyle () 和 FrameBorderStyle .
This enum describes how a frame is located relative to the surrounding text.
| 常量 | 值 |
|---|---|
QTextFrameFormat::InFlow
|
0
|
QTextFrameFormat::FloatLeft
|
1
|
QTextFrameFormat::FloatRight
|
2
|
Constructs a text frame format object with the default properties.
Returns the width of the border in pixels.
另請參閱 setBorder ().
Returns the brush used for the frame's border.
該函數在 Qt 4.3 引入。
另請參閱 setBorderBrush ().
Returns the style of the frame's border.
該函數在 Qt 4.3 引入。
另請參閱 setBorderStyle ().
Returns the width of the frame's bottom margin in pixels.
該函數在 Qt 4.3 引入。
另請參閱 setBottomMargin ().
Returns the height of the frame's border rectangle.
另請參閱 setHeight ().
返迴
true
if the format description is valid; otherwise returns
false
.
Returns the width of the frame's left margin in pixels.
該函數在 Qt 4.3 引入。
另請參閱 setLeftMargin ().
Returns the width of the frame's external margin in pixels.
另請參閱 setMargin ().
Returns the width of the frame's internal padding in pixels.
另請參閱 setPadding ().
Returns the currently set page break policy for the frame/table. The default is QTextFormat::PageBreak_Auto .
該函數在 Qt 4.2 引入。
另請參閱 setPageBreakPolicy ().
Returns the positioning policy for frames with this frame format.
另請參閱 setPosition ().
Returns the width of the frame's right margin in pixels.
該函數在 Qt 4.3 引入。
另請參閱 setRightMargin ().
設置 width (in pixels) of the frame's border.
另請參閱 border ().
設置 brush used for the frame's border.
該函數在 Qt 4.3 引入。
另請參閱 borderBrush ().
設置 style of the frame's border.
該函數在 Qt 4.3 引入。
另請參閱 borderStyle ().
Sets the frame's bottom margin (以像素為單位)。
該函數在 Qt 4.3 引入。
另請參閱 bottomMargin ().
Sets the frame's height .
另請參閱 height ().
這是重載函數。
Sets the frame's height .
Sets the frame's left margin (以像素為單位)。
該函數在 Qt 4.3 引入。
另請參閱 leftMargin ().
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.
另請參閱 margin ().
設置 width of the frame's internal padding in pixels.
另請參閱 padding ().
Sets the page break policy for the frame/table to policy .
該函數在 Qt 4.2 引入。
另請參閱 pageBreakPolicy ().
設置 policy for positioning frames with this frame format.
另請參閱 position ().
Sets the frame's right margin (以像素為單位)。
該函數在 Qt 4.3 引入。
另請參閱 rightMargin ().
Sets the frame's top margin (以像素為單位)。
該函數在 Qt 4.3 引入。
另請參閱 topMargin ().
Sets the frame's border rectangle's width .
另請參閱 width () 和 QTextLength .
這是重載函數。
Convenience method that sets the width of the frame's border rectangle's width to the specified fixed width .
Returns the width of the frame's top margin in pixels.
該函數在 Qt 4.3 引入。
另請參閱 setTopMargin ().
Returns the width of the frame's border rectangle.
另請參閱 setWidth () 和 QTextLength .