![]() |
CopperSpice API
1.9.2
|
The QTextFrameFormat class provides formatting information for frames in a QTextDocument. More...
Public Types | |
enum | BorderStyle |
enum | Position |
![]() | |
enum | FormatType |
enum | ObjectTypes |
enum | Property |
Public Methods | |
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 |
![]() | |
QTextFormat () | |
QTextFormat (const QTextFormat &other) | |
QTextFormat (int type) | |
~QTextFormat () | |
QBrush | background () const |
bool | boolProperty (int propertyId) const |
QBrush | brushProperty (int propertyId) const |
void | clearBackground () |
void | clearForeground () |
void | clearProperty (int propertyId) |
QColor | colorProperty (int propertyId) const |
qreal | doubleProperty (int propertyId) const |
QBrush | foreground () const |
bool | hasProperty (int propertyId) const |
int | intProperty (int propertyId) const |
bool | isBlockFormat () const |
bool | isCharFormat () const |
bool | isEmpty () const |
bool | isFrameFormat () const |
bool | isImageFormat () const |
bool | isListFormat () const |
bool | isTableCellFormat () const |
bool | isTableFormat () const |
bool | isValid () const |
Qt::LayoutDirection | layoutDirection () const |
QTextLength | lengthProperty (int propertyId) const |
QVector< QTextLength > | lengthVectorProperty (int propertyId) const |
void | merge (const QTextFormat &other) |
int | objectIndex () const |
int | objectType () const |
operator QVariant () const | |
bool | operator!= (const QTextFormat &other) const |
QTextFormat & | operator= (const QTextFormat &other) |
bool | operator== (const QTextFormat &other) const |
QPen | penProperty (int propertyId) const |
QMap< int, QVariant > | properties () const |
QVariant | property (int propertyId) const |
int | propertyCount () const |
void | setBackground (const QBrush &brush) |
void | setForeground (const QBrush &brush) |
void | setLayoutDirection (Qt::LayoutDirection direction) |
void | setObjectIndex (int index) |
void | setObjectType (int type) |
void | setProperty (int propertyId, const QVariant &value) |
void | setProperty (int propertyId, const QVector< QTextLength > &value) |
QString | stringProperty (int propertyId) const |
void | swap (QTextFormat &other) |
QTextBlockFormat | toBlockFormat () const |
QTextCharFormat | toCharFormat () const |
QTextFrameFormat | toFrameFormat () const |
QTextImageFormat | toImageFormat () const |
QTextListFormat | toListFormat () const |
QTextTableCellFormat | toTableCellFormat () const |
QTextTableFormat | toTableFormat () const |
int | type () const |
Friends | |
class | QTextFormat |
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() 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 QTextFrameFormat object can be determined with the isValid() method.
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 describes how a frame is located relative to the surrounding text.
Constant | Value |
---|---|
QTextFrameFormat::InFlow | 0 |
QTextFrameFormat::FloatLeft | 1 |
QTextFrameFormat::FloatRight | 2 |
QTextFrameFormat::QTextFrameFormat | ( | ) |
Constructs a text frame format object with the default properties.
|
inline |
Returns the width of the border in pixels.
|
inline |
Returns the brush used for the frame's border.
|
inline |
Returns the style of the frame's border.
qreal QTextFrameFormat::bottomMargin | ( | ) | const |
Returns the width of the frame's bottom margin in pixels.
|
inline |
Returns the height of the frame's border rectangle.
|
inline |
Returns true if the format description is valid, otherwise returns false.
qreal QTextFrameFormat::leftMargin | ( | ) | const |
Returns the width of the frame's left margin in pixels.
|
inline |
Returns the width of the frame's external margin in pixels.
|
inline |
Returns the width of the frame's internal padding in pixels.
|
inline |
Returns the currently set page break policy for the frame/table. The default is QTextFormat::PageBreak_Auto.
|
inline |
Returns the positioning policy for frames with this frame format.
qreal QTextFrameFormat::rightMargin | ( | ) | const |
Returns the width of the frame's right margin in pixels.
|
inline |
Sets the width (in pixels) of the frame's border.
|
inline |
Sets the brush used for the frame's border.
|
inline |
Sets the style of the frame's border.
|
inline |
Sets the frame's bottom margin in pixels.
|
inline |
Sets the frame's height.
|
inline |
Sets the frame's height.
|
inline |
Sets the frame's left margin in pixels.
void QTextFrameFormat::setMargin | ( | qreal | margin | ) |
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.
|
inline |
Sets the width of the frame's internal padding in pixels.
|
inline |
Sets the page break policy for the frame/table to policy.
|
inline |
Sets the policy for positioning frames with this frame format.
|
inline |
Sets the frame's right margin in pixels.
|
inline |
Sets the frame's top margin in pixels.
|
inline |
Sets the frame's border rectangle's width.
|
inline |
Sets the width of the frame's border rectangle's width to the specified fixed width.
qreal QTextFrameFormat::topMargin | ( | ) | const |
Returns the width of the frame's top margin in pixels.
|
inline |
Returns the width of the frame's border rectangle.