QTextFrameFormat Class

The QTextFrameFormat class provides formatting information for frames in a QTextDocument. More...

Header: #include <QTextFrameFormat>
qmake: QT += gui
Inherits: QTextFormat
Inherited By:

QTextTableFormat

Note: All functions in this class are reentrant.

Public Types

enum BorderStyle { BorderStyle_None, BorderStyle_Dotted, BorderStyle_Dashed, BorderStyle_Solid, ..., BorderStyle_Outset }
enum Position { InFlow, FloatLeft, FloatRight }

Public Functions

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 border)
void setBorderBrush(const QBrush &brush)
void setBorderStyle(QTextFrameFormat::BorderStyle style)
void setBottomMargin(qreal margin)
void setHeight(qreal height)
void setHeight(const QTextLength &height)
void setLeftMargin(qreal margin)
void setMargin(qreal margin)
void setPadding(qreal padding)
void setPageBreakPolicy(QTextFormat::PageBreakFlags flags)
void setPosition(QTextFrameFormat::Position f)
void setRightMargin(qreal margin)
void setTopMargin(qreal margin)
void setWidth(qreal width)
void setWidth(const QTextLength &length)
qreal topMargin() const
QTextLength width() const

Protected Functions

QTextFrameFormat(const QTextFormat &fmt)

Detailed Description

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() function.

See also QTextFrame and QTextBlockFormat.

Member Type Documentation

enum QTextFrameFormat::BorderStyle

This enum describes different border styles for the text frame.

ConstantValue
QTextFrameFormat::BorderStyle_None0
QTextFrameFormat::BorderStyle_Dotted1
QTextFrameFormat::BorderStyle_Dashed2
QTextFrameFormat::BorderStyle_Solid3
QTextFrameFormat::BorderStyle_Double4
QTextFrameFormat::BorderStyle_DotDash5
QTextFrameFormat::BorderStyle_DotDotDash6
QTextFrameFormat::BorderStyle_Groove7
QTextFrameFormat::BorderStyle_Ridge8
QTextFrameFormat::BorderStyle_Inset9
QTextFrameFormat::BorderStyle_Outset10

This enum was introduced or modified in Qt 4.3.

See also borderStyle() and FrameBorderStyle.

enum QTextFrameFormat::Position

This enum describes how a frame is located relative to the surrounding text.

ConstantValue
QTextFrameFormat::InFlow0
QTextFrameFormat::FloatLeft1
QTextFrameFormat::FloatRight2

See also position() and CssFloat.

Member Function Documentation

QTextFrameFormat::QTextFrameFormat()

Default constructs an instance of QTextFrameFormat.

[protected] QTextFrameFormat::QTextFrameFormat(const QTextFormat &fmt)

Default constructs an instance of QTextFrameFormat.

qreal QTextFrameFormat::border() const

See also setBorder().

QBrush QTextFrameFormat::borderBrush() const

See also setBorderBrush().

QTextFrameFormat::BorderStyle QTextFrameFormat::borderStyle() const

See also setBorderStyle().

qreal QTextFrameFormat::bottomMargin() const

See also setBottomMargin().

QTextLength QTextFrameFormat::height() const

See also setHeight().

bool QTextFrameFormat::isValid() const

qreal QTextFrameFormat::leftMargin() const

See also setLeftMargin().

qreal QTextFrameFormat::margin() const

See also setMargin().

qreal QTextFrameFormat::padding() const

See also setPadding().

QTextFormat::PageBreakFlags QTextFrameFormat::pageBreakPolicy() const

See also setPageBreakPolicy().

QTextFrameFormat::Position QTextFrameFormat::position() const

See also setPosition().

qreal QTextFrameFormat::rightMargin() const

See also setRightMargin().

void QTextFrameFormat::setBorder(qreal border)

See also border().

void QTextFrameFormat::setBorderBrush(const QBrush &brush)

See also borderBrush().

void QTextFrameFormat::setBorderStyle(QTextFrameFormat::BorderStyle style)

See also borderStyle().

void QTextFrameFormat::setBottomMargin(qreal margin)

See also bottomMargin().

void QTextFrameFormat::setHeight(qreal height)

See also height().

void QTextFrameFormat::setHeight(const QTextLength &height)

void QTextFrameFormat::setLeftMargin(qreal margin)

See also leftMargin().

void QTextFrameFormat::setMargin(qreal margin)

See also margin().

void QTextFrameFormat::setPadding(qreal padding)

See also padding().

void QTextFrameFormat::setPageBreakPolicy(QTextFormat::PageBreakFlags flags)

See also pageBreakPolicy().

void QTextFrameFormat::setPosition(QTextFrameFormat::Position f)

See also position().

void QTextFrameFormat::setRightMargin(qreal margin)

See also rightMargin().

void QTextFrameFormat::setTopMargin(qreal margin)

See also topMargin().

void QTextFrameFormat::setWidth(qreal width)

See also width().

void QTextFrameFormat::setWidth(const QTextLength &length)

qreal QTextFrameFormat::topMargin() const

See also setTopMargin().

QTextLength QTextFrameFormat::width() const

See also setWidth().