
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQTextFrameFormat class provides formatting information for frames in aQTextDocument.More...
| Header: | #include <QTextFrameFormat> |
| Inherits: | QTextFormat |
| Inherited By: |
Note: All functions in this class arereentrant.
| enum | BorderStyle { BorderStyle_None, BorderStyle_Dotted, BorderStyle_Dashed, BorderStyle_Solid, ..., BorderStyle_Outset } |
| enum | Position { InFlow, FloatLeft, FloatRight } |
| QTextFrameFormat() | |
| qreal | border() const |
| QBrush | borderBrush() const |
| BorderStyle | borderStyle() const |
| qreal | bottomMargin() const |
| QTextLength | height() const |
| bool | isValid() const |
| qreal | leftMargin() const |
| qreal | margin() const |
| qreal | padding() const |
| PageBreakFlags | pageBreakPolicy() const |
| Position | position() const |
| qreal | rightMargin() const |
| void | setBorder(qreal width) |
| void | setBorderBrush(const QBrush & brush) |
| void | setBorderStyle(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(PageBreakFlags policy) |
| void | setPosition(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 |
TheQTextFrameFormat class provides formatting information for frames in aQTextDocument.
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 thewidth() 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.

Theposition() of a frame is set usingsetPosition() and determines how it is located relative to the surrounding text.
The validity of aQTextFrameFormat object can be determined with theisValid() function.
See alsoQTextFrame andQTextBlockFormat.
This enum describes different border styles for the text frame.
| Constant | Value |
|---|---|
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 |
This enum was introduced or modified in Qt 4.3.
See alsoborderStyle() andFrameBorderStyle.
This enum describes how a frame is located relative to the surrounding text.
| Constant | Value |
|---|---|
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.
See alsosetBorder().
Returns the brush used for the frame's border.
This function was introduced in Qt 4.3.
See alsosetBorderBrush().
Returns the style of the frame's border.
This function was introduced in Qt 4.3.
See alsosetBorderStyle().
Returns the width of the frame's bottom margin in pixels.
This function was introduced in Qt 4.3.
See alsosetBottomMargin().
Returns the height of the frame's border rectangle.
See alsosetHeight().
Returns true if the format description is valid; otherwise returns false.
Returns the width of the frame's left margin in pixels.
This function was introduced in Qt 4.3.
See alsosetLeftMargin().
Returns the width of the frame's external margin in pixels.
See alsosetMargin().
Returns the width of the frame's internal padding in pixels.
See alsosetPadding().
Returns the currently set page break policy for the frame/table. The default isQTextFormat::PageBreak_Auto.
This function was introduced in Qt 4.2.
See alsosetPageBreakPolicy().
Returns the positioning policy for frames with this frame format.
See alsosetPosition().
Returns the width of the frame's right margin in pixels.
This function was introduced in Qt 4.3.
See alsosetRightMargin().
Sets thewidth (in pixels) of the frame's border.
See alsoborder().
Sets thebrush used for the frame's border.
This function was introduced in Qt 4.3.
See alsoborderBrush().
Sets thestyle of the frame's border.
This function was introduced in Qt 4.3.
See alsoborderStyle().
Sets the frame's bottommargin in pixels.
This function was introduced in Qt 4.3.
See alsobottomMargin().
Sets the frame'sheight.
See alsoheight().
This is an overloaded function.
Sets the frame'sheight.
Sets the frame's leftmargin in pixels.
This function was introduced in Qt 4.3.
See alsoleftMargin().
Sets the frame'smargin 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 alsomargin().
Sets thewidth of the frame's internal padding in pixels.
See alsopadding().
Sets the page break policy for the frame/table topolicy.
This function was introduced in Qt 4.2.
See alsopageBreakPolicy().
Sets thepolicy for positioning frames with this frame format.
See alsoposition().
Sets the frame's rightmargin in pixels.
This function was introduced in Qt 4.3.
See alsorightMargin().
Sets the frame's topmargin in pixels.
This function was introduced in Qt 4.3.
See alsotopMargin().
Sets the frame's border rectangle'swidth.
See alsowidth() andQTextLength.
This is an overloaded function.
Convenience method that sets the width of the frame's border rectangle's width to the specified fixedwidth.
Returns the width of the frame's top margin in pixels.
This function was introduced in Qt 4.3.
See alsosetTopMargin().
Returns the width of the frame's border rectangle.
See alsosetWidth() andQTextLength.
© 2016 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 theGNU 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.