IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QTextFrameFormat Class

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

All functions in this class are reentrant.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QTextFrameFormat Class▲

  • Header: QTextFrameFormat

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Gui)

    target_link_libraries(mytarget PRIVATE Qt6::Gui)

  • qmake: QT += gui

  • Inherits: QTextFormat

  • Inherited By: QTextTableFormat

  • Group: QTextFrameFormat is part of Rich Text Processing APIs, shared

Detailed Description▲

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.

Image non disponible

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▲

Member Type Documentation▲

 

enum QTextFrameFormat::BorderStyle▲

This enum describes different border styles for the text frame.

Constant

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

See Also▲

enum QTextFrameFormat::Position▲

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

Constant

QTextFrameFormat::InFlow

0

QTextFrameFormat::FloatLeft

1

QTextFrameFormat::FloatRight

2

See Also▲

See also position(), CssFloat

Member Function Documentation▲

 

QTextFrameFormat::QTextFrameFormat()▲

Constructs a text frame format object with the default properties.

qreal QTextFrameFormat::border() const▲

Returns the width of the border in pixels.

See Also▲

See also setBorder()

QBrush QTextFrameFormat::borderBrush() const▲

Returns the brush used for the frame's border.

See Also▲

See also setBorderBrush()

QTextFrameFormat::BorderStyle QTextFrameFormat::borderStyle() const▲

Returns the style of the frame's border.

See Also▲

See also setBorderStyle()

qreal QTextFrameFormat::bottomMargin() const▲

Returns the width of the frame's bottom margin in pixels.

See Also▲

See also setBottomMargin()

QTextLength QTextFrameFormat::height() const▲

Returns the height of the frame's border rectangle.

See Also▲

See also setHeight()

bool QTextFrameFormat::isValid() const▲

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.

See Also▲

See also setLeftMargin()

qreal QTextFrameFormat::margin() const▲

Returns the width of the frame's external margin in pixels.

See Also▲

See also setMargin()

qreal QTextFrameFormat::padding() const▲

Returns the width of the frame's internal padding in pixels.

See Also▲

See also setPadding()

QTextFormat::PageBreakFlags QTextFrameFormat::pageBreakPolicy() const▲

Returns the currently set page break policy for the frame/table. The default is QTextFormat::PageBreak_Auto.

See Also▲

See also setPageBreakPolicy()

QTextFrameFormat::Position QTextFrameFormat::position() const▲

Returns the positioning policy for frames with this frame format.

See Also▲

See also setPosition()

qreal QTextFrameFormat::rightMargin() const▲

Returns the width of the frame's right margin in pixels.

See Also▲

See also setRightMargin()

void QTextFrameFormat::setBorder(qreal width)▲

Sets the width (in pixels) of the frame's border.

See Also▲

See also border()

void QTextFrameFormat::setBorderBrush(const QBrush &brush)▲

Sets the brush used for the frame's border.

See Also▲

See also borderBrush()

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

Sets the style of the frame's border.

See Also▲

See also borderStyle()

void QTextFrameFormat::setBottomMargin(qreal margin)▲

Sets the frame's bottom margin in pixels.

See Also▲

See also bottomMargin()

void QTextFrameFormat::setHeight(const QTextLength &height)▲

Sets the frame's height.

See Also▲

See also height()

void QTextFrameFormat::setHeight(qreal height)▲

This is an overloaded function.

Sets the frame's height.

void QTextFrameFormat::setLeftMargin(qreal margin)▲

Sets the frame's left margin in pixels.

See Also▲

See also leftMargin()

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.

See Also▲

See also margin()

void QTextFrameFormat::setPadding(qreal width)▲

Sets the width of the frame's internal padding in pixels.

See Also▲

See also padding()

void QTextFrameFormat::setPageBreakPolicy(QTextFormat::PageBreakFlags policy)▲

Sets the page break policy for the frame/table to policy.

See Also▲

See also pageBreakPolicy()

void QTextFrameFormat::setPosition(QTextFrameFormat::Position policy)▲

Sets the policy for positioning frames with this frame format.

See Also▲

See also position()

void QTextFrameFormat::setRightMargin(qreal margin)▲

Sets the frame's right margin in pixels.

See Also▲

See also rightMargin()

void QTextFrameFormat::setTopMargin(qreal margin)▲

Sets the frame's top margin in pixels.

See Also▲

See also topMargin()

void QTextFrameFormat::setWidth(const QTextLength &width)▲

Sets the frame's border rectangle's width.

See Also▲

See also width(), QTextLength

void QTextFrameFormat::setWidth(qreal width)▲

This is an overloaded function.

Convenience method that 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.

See Also▲

See also setTopMargin()

QTextLength QTextFrameFormat::width() const▲

Returns the width of the frame's border rectangle.

See Also▲

See also setWidth(), QTextLength

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+