Qt 4.8
Public Types | Public Functions | Protected Functions | Friends | List of all members
QTextFrameFormat Class Reference

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

#include <qtextformat.h>

Inheritance diagram for QTextFrameFormat:
QTextFormat QTextTableFormat

Public Types

enum  BorderStyle {
  BorderStyle_None, BorderStyle_Dotted, BorderStyle_Dashed, BorderStyle_Solid,
  BorderStyle_Double, BorderStyle_DotDash, BorderStyle_DotDotDash, BorderStyle_Groove,
  BorderStyle_Ridge, BorderStyle_Inset, BorderStyle_Outset
}
 This enum describes different border styles for the text frame. More...
 
enum  Position { InFlow, FloatLeft, FloatRight }
 This enum describes how a frame is located relative to the surrounding text. More...
 
- Public Types inherited from QTextFormat
enum  FormatType {
  InvalidFormat = -1, BlockFormat = 1, CharFormat = 2, ListFormat = 3,
  TableFormat = 4, FrameFormat = 5, UserFormat = 100
}
 This enum describes the text item a QTextFormat object is formatting. More...
 
enum  ObjectTypes {
  NoObject, ImageObject, TableObject, TableCellObject,
  UserObject = 0x1000
}
 This enum describes what kind of QTextObject this format is associated with. More...
 
enum  PageBreakFlag { PageBreak_Auto = 0, PageBreak_AlwaysBefore = 0x001, PageBreak_AlwaysAfter = 0x010 }
 This enum describes how page breaking is performed when printing. More...
 
enum  Property {
  ObjectIndex = 0x0, CssFloat = 0x0800, LayoutDirection = 0x0801, OutlinePen = 0x810,
  BackgroundBrush = 0x820, ForegroundBrush = 0x821, BackgroundImageUrl = 0x823, BlockAlignment = 0x1010,
  BlockTopMargin = 0x1030, BlockBottomMargin = 0x1031, BlockLeftMargin = 0x1032, BlockRightMargin = 0x1033,
  TextIndent = 0x1034, TabPositions = 0x1035, BlockIndent = 0x1040, LineHeight = 0x1048,
  LineHeightType = 0x1049, BlockNonBreakableLines = 0x1050, BlockTrailingHorizontalRulerWidth = 0x1060, FirstFontProperty = 0x1FE0,
  FontCapitalization = FirstFontProperty, FontLetterSpacing = 0x1FE1, FontWordSpacing = 0x1FE2, FontStyleHint = 0x1FE3,
  FontStyleStrategy = 0x1FE4, FontKerning = 0x1FE5, FontHintingPreference = 0x1FE6, FontFamily = 0x2000,
  FontPointSize = 0x2001, FontSizeAdjustment = 0x2002, FontSizeIncrement = FontSizeAdjustment, FontWeight = 0x2003,
  FontItalic = 0x2004, FontUnderline = 0x2005, FontOverline = 0x2006, FontStrikeOut = 0x2007,
  FontFixedPitch = 0x2008, FontPixelSize = 0x2009, LastFontProperty = FontPixelSize, TextUnderlineColor = 0x2010,
  TextVerticalAlignment = 0x2021, TextOutline = 0x2022, TextUnderlineStyle = 0x2023, TextToolTip = 0x2024,
  IsAnchor = 0x2030, AnchorHref = 0x2031, AnchorName = 0x2032, ObjectType = 0x2f00,
  ListStyle = 0x3000, ListIndent = 0x3001, ListNumberPrefix = 0x3002, ListNumberSuffix = 0x3003,
  FrameBorder = 0x4000, FrameMargin = 0x4001, FramePadding = 0x4002, FrameWidth = 0x4003,
  FrameHeight = 0x4004, FrameTopMargin = 0x4005, FrameBottomMargin = 0x4006, FrameLeftMargin = 0x4007,
  FrameRightMargin = 0x4008, FrameBorderBrush = 0x4009, FrameBorderStyle = 0x4010, TableColumns = 0x4100,
  TableColumnWidthConstraints = 0x4101, TableCellSpacing = 0x4102, TableCellPadding = 0x4103, TableHeaderRowCount = 0x4104,
  TableCellRowSpan = 0x4810, TableCellColumnSpan = 0x4811, TableCellTopPadding = 0x4812, TableCellBottomPadding = 0x4813,
  TableCellLeftPadding = 0x4814, TableCellRightPadding = 0x4815, ImageName = 0x5000, ImageWidth = 0x5010,
  ImageHeight = 0x5011, FullWidthSelection = 0x06000, PageBreakPolicy = 0x7000, UserProperty = 0x100000
}
 This enum describes the different properties a format can have. More...
 

Public Functions

qreal border () const
 Returns the width of the border in pixels. More...
 
QBrush borderBrush () const
 Returns the brush used for the frame's border. More...
 
BorderStyle borderStyle () const
 Returns the style of the frame's border. More...
 
qreal bottomMargin () const
 Returns the width of the frame's bottom margin in pixels. More...
 
QTextLength height () const
 Returns the height of the frame's border rectangle. More...
 
bool isValid () const
 Returns true if the format description is valid; otherwise returns false. More...
 
qreal leftMargin () const
 Returns the width of the frame's left margin in pixels. More...
 
qreal margin () const
 Returns the width of the frame's external margin in pixels. More...
 
qreal padding () const
 Returns the width of the frame's internal padding in pixels. More...
 
PageBreakFlags pageBreakPolicy () const
 Returns the currently set page break policy for the frame/table. More...
 
Position position () const
 Returns the positioning policy for frames with this frame format. More...
 
 QTextFrameFormat ()
 Constructs a text frame format object with the default properties. More...
 
qreal rightMargin () const
 Returns the width of the frame's right margin in pixels. More...
 
void setBorder (qreal border)
 Sets the width (in pixels) of the frame's border. More...
 
void setBorderBrush (const QBrush &brush)
 Sets the brush used for the frame's border. More...
 
void setBorderStyle (BorderStyle style)
 Sets the style of the frame's border. More...
 
void setBottomMargin (qreal margin)
 Sets the frame's bottom margin in pixels. More...
 
void setHeight (qreal height)
 Sets the frame's height. More...
 
void setHeight (const QTextLength &height)
 Sets the frame's height. More...
 
void setLeftMargin (qreal margin)
 Sets the frame's left margin in pixels. More...
 
void setMargin (qreal margin)
 Sets the frame's margin in pixels. More...
 
void setPadding (qreal padding)
 Sets the width of the frame's internal padding in pixels. More...
 
void setPageBreakPolicy (PageBreakFlags flags)
 Sets the page break policy for the frame/table to policy. More...
 
void setPosition (Position f)
 Sets the policy for positioning frames with this frame format. More...
 
void setRightMargin (qreal margin)
 Sets the frame's right margin in pixels. More...
 
void setTopMargin (qreal margin)
 Sets the frame's top margin in pixels. More...
 
void setWidth (qreal width)
 Convenience method that sets the width of the frame's border rectangle's width to the specified fixed width. More...
 
void setWidth (const QTextLength &length)
 Sets the frame's border rectangle's width. More...
 
qreal topMargin () const
 Returns the width of the frame's top margin in pixels. More...
 
QTextLength width () const
 Returns the width of the frame's border rectangle. More...
 
- Public Functions inherited from QTextFormat
QBrush background () const
 Returns the brush used to paint the document's background. More...
 
bool boolProperty (int propertyId) const
 Returns the value of the property specified by propertyId. More...
 
QBrush brushProperty (int propertyId) const
 Returns the value of the property given by propertyId; if the property isn't of QVariant::Brush type, Qt::NoBrush is returned instead. More...
 
void clearBackground ()
 Clears the brush used to paint the document's background. More...
 
void clearForeground ()
 Clears the brush used to paint the document's foreground. More...
 
void clearProperty (int propertyId)
 Clears the value of the property given by propertyId. More...
 
QColor colorProperty (int propertyId) const
 Returns the value of the property given by propertyId; if the property isn't of QVariant::Color type, an invalid color is returned instead. More...
 
qreal doubleProperty (int propertyId) const
 Returns the value of the property specified by propertyId. More...
 
QBrush foreground () const
 Returns the brush used to render foreground details, such as text, frame outlines, and table borders. More...
 
bool hasProperty (int propertyId) const
 Returns true if the text format has a property with the given propertyId; otherwise returns false. More...
 
int intProperty (int propertyId) const
 Returns the value of the property specified by propertyId. More...
 
bool isBlockFormat () const
 Returns true if this text format is a BlockFormat; otherwise returns false. More...
 
bool isCharFormat () const
 Returns true if this text format is a CharFormat; otherwise returns false. More...
 
bool isFrameFormat () const
 Returns true if this text format is a FrameFormat; otherwise returns false. More...
 
bool isImageFormat () const
 Returns true if this text format is an image format; otherwise returns false. More...
 
bool isListFormat () const
 Returns true if this text format is a ListFormat; otherwise returns false. More...
 
bool isTableCellFormat () const
 Returns true if this text format is a TableCellFormat; otherwise returns false. More...
 
bool isTableFormat () const
 Returns true if this text format is a TableFormat; otherwise returns false. More...
 
bool isValid () const
 Returns true if the format is valid (i. More...
 
Qt::LayoutDirection layoutDirection () const
 Returns the document's layout direction. More...
 
QTextLength lengthProperty (int propertyId) const
 Returns the value of the property given by propertyId. More...
 
QVector< QTextLengthlengthVectorProperty (int propertyId) const
 Returns the value of the property given by propertyId. More...
 
void merge (const QTextFormat &other)
 Merges the other format with this format; where there are conflicts the other format takes precedence. More...
 
int objectIndex () const
 Returns the index of the format object, or -1 if the format object is invalid. More...
 
int objectType () const
 Returns the text format's object type. More...
 
 operator QVariant () const
 Returns the text format as a QVariant. More...
 
bool operator!= (const QTextFormat &rhs) const
 Returns true if this text format is different from the other text format. More...
 
QTextFormatoperator= (const QTextFormat &rhs)
 Assigns the other text format to this text format, and returns a reference to this text format. More...
 
bool operator== (const QTextFormat &rhs) const
 Returns true if this text format is the same as the other text format. More...
 
QPen penProperty (int propertyId) const
 Returns the value of the property given by propertyId; if the property isn't of QVariant::Pen type, Qt::NoPen is returned instead. More...
 
QMap< int, QVariantproperties () const
 Returns a map with all properties of this text format. More...
 
QVariant property (int propertyId) const
 Returns the property specified by the given propertyId. More...
 
int propertyCount () const
 Returns the number of properties stored in the format. More...
 
 QTextFormat ()
 Creates a new text format with an InvalidFormat. More...
 
 QTextFormat (int type)
 Creates a new text format of the given type. More...
 
 QTextFormat (const QTextFormat &rhs)
 Creates a new text format with the same attributes as the other text format. More...
 
void setBackground (const QBrush &brush)
 Sets the brush use to paint the document's background to the brush specified. More...
 
void setForeground (const QBrush &brush)
 Sets the foreground brush to the specified brush. More...
 
void setLayoutDirection (Qt::LayoutDirection direction)
 Sets the document's layout direction to the specified direction. More...
 
void setObjectIndex (int object)
 Sets the format object's object index. More...
 
void setObjectType (int type)
 Sets the text format's object type to type. More...
 
void setProperty (int propertyId, const QVariant &value)
 Sets the property specified by the propertyId to the given value. More...
 
void setProperty (int propertyId, const QVector< QTextLength > &lengths)
 Sets the value of the property given by propertyId to value. More...
 
QString stringProperty (int propertyId) const
 Returns the value of the property given by propertyId; if the property isn't of QVariant::String type, an empty string is returned instead. More...
 
QTextBlockFormat toBlockFormat () const
 Returns this format as a block format. More...
 
QTextCharFormat toCharFormat () const
 Returns this format as a character format. More...
 
QTextFrameFormat toFrameFormat () const
 Returns this format as a frame format. More...
 
QTextImageFormat toImageFormat () const
 Returns this format as an image format. More...
 
QTextListFormat toListFormat () const
 Returns this format as a list format. More...
 
QTextTableCellFormat toTableCellFormat () const
 Returns this format as a table cell format. More...
 
QTextTableFormat toTableFormat () const
 Returns this format as a table format. More...
 
int type () const
 Returns the type of this format. More...
 
 ~QTextFormat ()
 Destroys this text format. More...
 

Protected Functions

 QTextFrameFormat (const QTextFormat &fmt)
 Creates a new frame format with the same attributes as the given text format. More...
 

Friends

class QTextFormat
 

Detailed Description

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

Note
This class or function is reentrant.

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.

qtextframe-style.png

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 QTextBlockFormat

Definition at line 727 of file qtextformat.h.

Enumerations

◆ BorderStyle

This enum describes different border styles for the text frame.

Since
4.3
  • BorderStyle_None
  • BorderStyle_Dotted
  • BorderStyle_Dashed
  • BorderStyle_Solid
  • BorderStyle_Double
  • BorderStyle_DotDash
  • BorderStyle_DotDotDash
  • BorderStyle_Groove
  • BorderStyle_Ridge
  • BorderStyle_Inset
  • BorderStyle_Outset
See also
borderStyle() FrameBorderStyle
Enumerator
BorderStyle_None 
BorderStyle_Dotted 
BorderStyle_Dashed 
BorderStyle_Solid 
BorderStyle_Double 
BorderStyle_DotDash 
BorderStyle_DotDotDash 
BorderStyle_Groove 
BorderStyle_Ridge 
BorderStyle_Inset 
BorderStyle_Outset 

Definition at line 742 of file qtextformat.h.

◆ Position

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

  • InFlow
  • FloatLeft
  • FloatRight
See also
position() CssFloat
Enumerator
InFlow 
FloatLeft 
FloatRight 

Definition at line 734 of file qtextformat.h.

734  {
735  InFlow,
736  FloatLeft,
737  FloatRight
738  // ######
739 // Absolute
740  };

Constructors and Destructors

◆ QTextFrameFormat() [1/2]

QTextFrameFormat::QTextFrameFormat ( )

Constructs a text frame format object with the default properties.

Definition at line 2863 of file qtextformat.cpp.

2864 {
2867 }
QTextFormat()
Creates a new text format with an InvalidFormat.
void setBorderBrush(const QBrush &brush)
Sets the brush used for the frame&#39;s border.
Definition: qtextformat.h:765
void setBorderStyle(BorderStyle style)
Sets the style of the frame&#39;s border.
Definition: qtextformat.h:770

◆ QTextFrameFormat() [2/2]

QTextFrameFormat::QTextFrameFormat ( const QTextFormat other)
explicitprotected

Creates a new frame format with the same attributes as the given text format.

Warning
This function is not part of the public interface.

Definition at line 2879 of file qtextformat.cpp.

2880  : QTextFormat(fmt)
2881 {
2882 }
QTextFormat()
Creates a new text format with an InvalidFormat.

Functions

◆ border()

qreal QTextFrameFormat::border ( ) const
inline

Returns the width of the border in pixels.

Definition at line 762 of file qtextformat.h.

Referenced by QTextHtmlExporter::emitTable(), QTextHtmlExporter::emitTextFrame(), and QTextDocumentLayoutPrivate::layoutFrame().

763  { return doubleProperty(FrameBorder); }
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ borderBrush()

QBrush QTextFrameFormat::borderBrush ( ) const
inline

Returns the brush used for the frame's border.

Since
4.3

Definition at line 767 of file qtextformat.h.

Referenced by QTextDocumentLayoutPrivate::drawFrameDecoration(), QTextDocumentLayoutPrivate::drawTableCell(), and QTextHtmlExporter::emitFrameStyle().

768  { return brushProperty(FrameBorderBrush); }
QBrush brushProperty(int propertyId) const
Returns the value of the property given by propertyId; if the property isn&#39;t of QVariant::Brush type...

◆ borderStyle()

BorderStyle QTextFrameFormat::borderStyle ( ) const
inline

Returns the style of the frame's border.

Since
4.3

Definition at line 772 of file qtextformat.h.

Referenced by QTextDocumentLayoutPrivate::drawFrameDecoration(), QTextDocumentLayoutPrivate::drawTableCell(), and QTextHtmlExporter::emitFrameStyle().

773  { return static_cast<BorderStyle>(intProperty(FrameBorderStyle)); }
int intProperty(int propertyId) const
Returns the value of the property specified by propertyId.
BorderStyle
This enum describes different border styles for the text frame.
Definition: qtextformat.h:742

◆ bottomMargin()

qreal QTextFrameFormat::bottomMargin ( ) const

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

Since
4.3

Definition at line 3045 of file qtextformat.cpp.

Referenced by QGraphicsTextItemPrivate::_q_mouseOnEdge(), QTextHtmlExporter::emitFrameStyle(), QTextDocumentLayoutPrivate::layoutFrame(), QTextHtmlImporter::scanTable(), and QTextOdfWriter::writeFrameFormat().

3046 {
3048  return margin();
3050 }
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false...
qreal margin() const
Returns the width of the frame&#39;s external margin in pixels.
Definition: qtextformat.h:776
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ height()

qreal QTextFrameFormat::height ( ) const
inline

Returns the height of the frame's border rectangle.

Definition at line 803 of file qtextformat.h.

Referenced by QTextHtmlExporter::emitTextFrame(), and QTextDocumentLayoutPrivate::layoutFrame().

804  { return lengthProperty(FrameHeight); }
QTextLength lengthProperty(int propertyId) const
Returns the value of the property given by propertyId.

◆ isValid()

QTextFrameFormat::isValid ( ) const
inline

Returns true if the format description is valid; otherwise returns false.

Definition at line 732 of file qtextformat.h.

732 { return isFrameFormat(); }
bool isFrameFormat() const
Returns true if this text format is a FrameFormat; otherwise returns false.
Definition: qtextformat.h:321

◆ leftMargin()

qreal QTextFrameFormat::leftMargin ( ) const

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

Since
4.3

Definition at line 3071 of file qtextformat.cpp.

Referenced by QGraphicsTextItemPrivate::_q_mouseOnEdge(), QTextHtmlExporter::emitFrameStyle(), QTextDocumentLayoutPrivate::layoutFrame(), QTextHtmlImporter::scanTable(), and QTextOdfWriter::writeFrameFormat().

3072 {
3074  return margin();
3076 }
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false...
qreal margin() const
Returns the width of the frame&#39;s external margin in pixels.
Definition: qtextformat.h:776
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ margin()

qreal QTextFrameFormat::margin ( ) const
inline

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

Definition at line 776 of file qtextformat.h.

Referenced by bottomMargin(), leftMargin(), rightMargin(), and topMargin().

777  { return doubleProperty(FrameMargin); }
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ padding()

qreal QTextFrameFormat::padding ( ) const
inline

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

Definition at line 792 of file qtextformat.h.

Referenced by QTextDocumentLayoutPrivate::layoutFrame().

793  { return doubleProperty(FramePadding); }
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ pageBreakPolicy()

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

Returns the currently set page break policy for the frame/table.

Since
4.2

The default is QTextFormat::PageBreak_Auto.

See also
setPageBreakPolicy()

Definition at line 808 of file qtextformat.h.

Referenced by QTextHtmlExporter::emitFrameStyle(), and QTextDocumentLayoutPrivate::layoutFlow().

809  { return PageBreakFlags(intProperty(PageBreakPolicy)); }
int intProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ position()

Position QTextFrameFormat::position ( ) const
inline

Returns the positioning policy for frames with this frame format.

Definition at line 758 of file qtextformat.h.

Referenced by QTextDocumentLayoutPrivate::drawFlow(), QTextHtmlExporter::emitFrameStyle(), QTextDocumentLayoutPrivate::floatMargins(), QTextDocumentLayoutPrivate::hitTest(), QTextDocumentLayoutPrivate::layoutCell(), QTextDocumentLayoutPrivate::layoutFlow(), QTextDocumentLayoutPrivate::positionFloat(), and QTextDocumentLayout::resizeInlineObject().

759  { return static_cast<Position>(intProperty(CssFloat)); }
Position
This enum describes how a frame is located relative to the surrounding text.
Definition: qtextformat.h:734
int intProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ rightMargin()

qreal QTextFrameFormat::rightMargin ( ) const

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

Since
4.3

Definition at line 3097 of file qtextformat.cpp.

Referenced by QGraphicsTextItemPrivate::_q_mouseOnEdge(), QTextHtmlExporter::emitFrameStyle(), QTextDocumentLayoutPrivate::layoutFrame(), QTextHtmlImporter::scanTable(), and QTextOdfWriter::writeFrameFormat().

3098 {
3100  return margin();
3102 }
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false...
qreal margin() const
Returns the width of the frame&#39;s external margin in pixels.
Definition: qtextformat.h:776
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ setBorder()

void QTextFrameFormat::setBorder ( qreal  border)
inline

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

Definition at line 816 of file qtextformat.h.

Referenced by QTextTableFormat::QTextTableFormat(), and QTextHtmlImporter::scanTable().

817 { setProperty(FrameBorder, aborder); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setBorderBrush()

QTextFrameFormat::setBorderBrush ( const QBrush brush)
inline

Sets the brush used for the frame's border.

Since
4.3

Definition at line 765 of file qtextformat.h.

Referenced by QTextFrameFormat(), and QTextHtmlImporter::scanTable().

766  { setProperty(FrameBorderBrush, brush); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setBorderStyle()

QTextFrameFormat::setBorderStyle ( BorderStyle  style)
inline

Sets the style of the frame's border.

Since
4.3

Definition at line 770 of file qtextformat.h.

Referenced by QTextFrameFormat(), and QTextHtmlImporter::scanTable().

771  { setProperty(FrameBorderStyle, style); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setBottomMargin()

void QTextFrameFormat::setBottomMargin ( qreal  margin)
inline

Sets the frame's bottom margin in pixels.

Since
4.3

Definition at line 833 of file qtextformat.h.

Referenced by QTextHtmlImporter::scanTable().

834 { setProperty(FrameBottomMargin, amargin); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setHeight() [1/2]

void QTextFrameFormat::setHeight ( qreal  height)
inline

Sets the frame's height.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 825 of file qtextformat.h.

Referenced by QTextHtmlImporter::scanTable().

void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.
The QTextLength class encapsulates the different types of length used in a QTextDocument.
Definition: qtextformat.h:84

◆ setHeight() [2/2]

void QTextFrameFormat::setHeight ( const QTextLength height)
inline

Sets the frame's height.

Definition at line 827 of file qtextformat.h.

828 { setProperty(FrameHeight, aheight); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setLeftMargin()

void QTextFrameFormat::setLeftMargin ( qreal  margin)
inline

Sets the frame's left margin in pixels.

Since
4.3

Definition at line 836 of file qtextformat.h.

Referenced by QTextHtmlImporter::scanTable().

837 { setProperty(FrameLeftMargin, amargin); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setMargin()

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.

Definition at line 2981 of file qtextformat.cpp.

Referenced by QLabelPrivate::ensureTextLayouted(), QTextDocumentPrivate::rootFrame(), QTextDocument::setDocumentMargin(), and QTextHtmlExporter::toHtml().

2982 {
2983  setProperty(FrameMargin, amargin);
2984  setProperty(FrameTopMargin, amargin);
2985  setProperty(FrameBottomMargin, amargin);
2986  setProperty(FrameLeftMargin, amargin);
2987  setProperty(FrameRightMargin, amargin);
2988 }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setPadding()

void QTextFrameFormat::setPadding ( qreal  padding)
inline

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

Definition at line 819 of file qtextformat.h.

820 { setProperty(FramePadding, apadding); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setPageBreakPolicy()

void QTextFrameFormat::setPageBreakPolicy ( PageBreakFlags  policy)
inline

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

Since
4.2
See also
pageBreakPolicy()

Definition at line 806 of file qtextformat.h.

Referenced by QTextHtmlImporter::scanTable().

807  { setProperty(PageBreakPolicy, int(flags)); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setPosition()

QTextFrameFormat::setPosition ( Position  f)
inline

Sets the policy for positioning frames with this frame format.

Definition at line 756 of file qtextformat.h.

Referenced by QTextCursor::insertImage(), and QTextHtmlImporter::scanTable().

757  { setProperty(CssFloat, f); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setRightMargin()

void QTextFrameFormat::setRightMargin ( qreal  margin)
inline

Sets the frame's right margin in pixels.

Since
4.3

Definition at line 839 of file qtextformat.h.

Referenced by QTextHtmlImporter::scanTable().

840 { setProperty(FrameRightMargin, amargin); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setTopMargin()

void QTextFrameFormat::setTopMargin ( qreal  margin)
inline

Sets the frame's top margin in pixels.

Since
4.3

Definition at line 830 of file qtextformat.h.

Referenced by QTextHtmlImporter::scanTable().

831 { setProperty(FrameTopMargin, amargin); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setWidth() [1/2]

void QTextFrameFormat::setWidth ( qreal  width)
inline

Convenience method that sets the width of the frame's border rectangle's width to the specified fixed width.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 822 of file qtextformat.h.

Referenced by QTextHtmlImporter::scanTable().

void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.
The QTextLength class encapsulates the different types of length used in a QTextDocument.
Definition: qtextformat.h:84

◆ setWidth() [2/2]

QTextFrameFormat::setWidth ( const QTextLength width)
inline

Sets the frame's border rectangle's width.

See also
QTextLength

Definition at line 796 of file qtextformat.h.

797  { setProperty(FrameWidth, length); }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ topMargin()

qreal QTextFrameFormat::topMargin ( ) const

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

Since
4.3

Definition at line 3019 of file qtextformat.cpp.

Referenced by QGraphicsTextItemPrivate::_q_mouseOnEdge(), QTextHtmlExporter::emitFrameStyle(), QTextDocumentLayoutPrivate::layoutFrame(), QTextHtmlImporter::scanTable(), and QTextOdfWriter::writeFrameFormat().

3020 {
3022  return margin();
3024 }
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false...
qreal margin() const
Returns the width of the frame&#39;s external margin in pixels.
Definition: qtextformat.h:776
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ width()

QTextLength QTextFrameFormat::width ( ) const
inline

Returns the width of the frame's border rectangle.

See also
QTextLength

Definition at line 798 of file qtextformat.h.

Referenced by QTextHtmlExporter::emitTable(), QTextHtmlExporter::emitTextFrame(), QTextDocumentLayoutPrivate::layoutFrame(), and QTextDocumentLayoutPrivate::layoutTable().

799  { return lengthProperty(FrameWidth); }
QTextLength lengthProperty(int propertyId) const
Returns the value of the property given by propertyId.

Friends and Related Functions

◆ QTextFormat

friend class QTextFormat
friend

Definition at line 813 of file qtextformat.h.


The documentation for this class was generated from the following files: