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

The QTextTableCellFormat class provides formatting information for table cells in a QTextDocument. More...

#include <qtextformat.h>

Inheritance diagram for QTextTableCellFormat:
QTextCharFormat QTextFormat

Public Functions

qreal bottomPadding () const
 Gets the bottom padding of the table cell. More...
 
bool isValid () const
 Returns true if this table cell format is valid; otherwise returns false. More...
 
qreal leftPadding () const
 Gets the left padding of the table cell. More...
 
 QTextTableCellFormat ()
 Constructs a new table cell format object. More...
 
qreal rightPadding () const
 Gets the right padding of the table cell. More...
 
void setBottomPadding (qreal padding)
 Sets the bottom padding of the table cell. More...
 
void setLeftPadding (qreal padding)
 Sets the left padding of the table cell. More...
 
void setPadding (qreal padding)
 Sets the left, right, top, and bottom padding of the table cell. More...
 
void setRightPadding (qreal padding)
 Sets the right padding of the table cell. More...
 
void setTopPadding (qreal padding)
 Sets the top padding of the table cell. More...
 
qreal topPadding () const
 Gets the top padding of the table cell. More...
 
- Public Functions inherited from QTextCharFormat
QString anchorHref () const
 Returns the text format's hypertext link, or an empty string if none has been set. More...
 
QString anchorName () const
 This function is deprecated. More...
 
QStringList anchorNames () const
 Returns the anchor names associated with this text format, or an empty string list if none has been set. More...
 
QFont font () const
 Returns the font for this character format. More...
 
QFont::Capitalization fontCapitalization () const
 Returns the current capitalization type of the font. More...
 
QString fontFamily () const
 Returns the text format's font family. More...
 
bool fontFixedPitch () const
 Returns true if the text format's font is fixed pitch; otherwise returns false. More...
 
QFont::HintingPreference fontHintingPreference () const
 Returns the hinting preference set for this text format. More...
 
bool fontItalic () const
 Returns true if the text format's font is italic; otherwise returns false. More...
 
bool fontKerning () const
 Returns true if the font kerning is enabled. More...
 
qreal fontLetterSpacing () const
 Returns the current letter spacing percentage. More...
 
bool fontOverline () const
 Returns true if the text format's font is overlined; otherwise returns false. More...
 
qreal fontPointSize () const
 Returns the font size used to display text in this format. More...
 
bool fontStrikeOut () const
 Returns true if the text format's font is struck out (has a horizontal line drawn through it); otherwise returns false. More...
 
QFont::StyleHint fontStyleHint () const
 Returns the font style hint. More...
 
QFont::StyleStrategy fontStyleStrategy () const
 Returns the current font style strategy. More...
 
bool fontUnderline () const
 Returns true if the text format's font is underlined; otherwise returns false. More...
 
int fontWeight () const
 Returns the text format's font weight. More...
 
qreal fontWordSpacing () const
 Returns the current word spacing value. More...
 
bool isAnchor () const
 Returns true if the text is formatted as an anchor; otherwise returns false. More...
 
bool isValid () const
 Returns true if this character format is valid; otherwise returns false. More...
 
 QTextCharFormat ()
 Constructs a new character format object. More...
 
void setAnchor (bool anchor)
 If anchor is true, text with this format represents an anchor, and is formatted in the appropriate way; otherwise the text is formatted normally. More...
 
void setAnchorHref (const QString &value)
 Sets the hypertext link for the text format to the given value. More...
 
void setAnchorName (const QString &name)
 This function is deprecated. More...
 
void setAnchorNames (const QStringList &names)
 Sets the text format's anchor names. More...
 
void setFont (const QFont &font)
 Sets the text format's font. More...
 
void setFontCapitalization (QFont::Capitalization capitalization)
 Sets the capitalization of the text that apppears in this font to capitalization. More...
 
void setFontFamily (const QString &family)
 Sets the text format's font family. More...
 
void setFontFixedPitch (bool fixedPitch)
 If fixedPitch is true, sets the text format's font to be fixed pitch; otherwise a non-fixed pitch font is used. More...
 
void setFontHintingPreference (QFont::HintingPreference hintingPreference)
 Sets the hinting preference of the text format's font to be hintingPreference. More...
 
void setFontItalic (bool italic)
 If italic is true, sets the text format's font to be italic; otherwise the font will be non-italic. More...
 
void setFontKerning (bool enable)
 Enables kerning for this font if enable is true; otherwise disables it. More...
 
void setFontLetterSpacing (qreal spacing)
 Sets the letter spacing of this format to the given spacing, in percent. More...
 
void setFontOverline (bool overline)
 If overline is true, sets the text format's font to be overlined; otherwise the font is displayed non-overlined. More...
 
void setFontPointSize (qreal size)
 Sets the text format's font size. More...
 
void setFontStrikeOut (bool strikeOut)
 If strikeOut is true, sets the text format's font with strike-out enabled (with a horizontal line through it); otherwise it is displayed without strikeout. More...
 
void setFontStyleHint (QFont::StyleHint hint, QFont::StyleStrategy strategy=QFont::PreferDefault)
 Sets the font style hint and strategy. More...
 
void setFontStyleStrategy (QFont::StyleStrategy strategy)
 Sets the font style strategy. More...
 
void setFontUnderline (bool underline)
 If underline is true, sets the text format's font to be underlined; otherwise it is displayed non-underlined. More...
 
void setFontWeight (int weight)
 Sets the text format's font weight to weight. More...
 
void setFontWordSpacing (qreal spacing)
 Sets the word spacing of this format to the given spacing, in pixels. More...
 
void setTableCellColumnSpan (int tableCellColumnSpan)
 If this character format is applied to characters in a table cell, the cell will span tableCellColumnSpan columns. More...
 
void setTableCellRowSpan (int tableCellRowSpan)
 If this character format is applied to characters in a table cell, the cell will span tableCellRowSpan rows. More...
 
void setTextOutline (const QPen &pen)
 Sets the pen used to draw the outlines of characters to the given pen. More...
 
void setToolTip (const QString &tip)
 Sets the tool tip for a fragment of text to the given text. More...
 
void setUnderlineColor (const QColor &color)
 Sets the underline color used for the characters with this format to the color specified. More...
 
void setUnderlineStyle (UnderlineStyle style)
 Sets the style of underlining the text to style. More...
 
void setVerticalAlignment (VerticalAlignment alignment)
 Sets the vertical alignment used for the characters with this format to the alignment specified. More...
 
int tableCellColumnSpan () const
 If this character format is applied to characters in a table cell, this function returns the number of columns spanned by the text (this may be 1); otherwise it returns 1. More...
 
int tableCellRowSpan () const
 If this character format is applied to characters in a table cell, this function returns the number of rows spanned by the text (this may be 1); otherwise it returns 1. More...
 
QPen textOutline () const
 Returns the pen used to draw the outlines of characters in this format. More...
 
QString toolTip () const
 Returns the tool tip that is displayed for a fragment of text. More...
 
QColor underlineColor () const
 Returns the color used to underline the characters with this format. More...
 
UnderlineStyle underlineStyle () const
 Returns the style of underlining the text. More...
 
VerticalAlignment verticalAlignment () const
 Returns the vertical alignment used for characters with this format. 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

 QTextTableCellFormat (const QTextFormat &fmt)
 Creates a new table cell format with the same attributes as the given text format. More...
 
- Protected Functions inherited from QTextCharFormat
 QTextCharFormat (const QTextFormat &fmt)
 Creates a new character format with the same attributes as the given text format. More...
 

Friends

class QTextFormat
 

Additional Inherited Members

- Public Types inherited from QTextCharFormat
enum  UnderlineStyle {
  NoUnderline, SingleUnderline, DashUnderline, DotLine,
  DashDotLine, DashDotDotLine, WaveUnderline, SpellCheckUnderline
}
 This enum describes the different ways drawing underlined text. More...
 
enum  VerticalAlignment {
  AlignNormal = 0, AlignSuperScript, AlignSubScript, AlignMiddle,
  AlignTop, AlignBottom, AlignBaseline
}
 This enum describes the ways that adjacent characters can be vertically aligned. 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...
 

Detailed Description

The QTextTableCellFormat class provides formatting information for table cells in a QTextDocument.

Note
This class or function is reentrant.
Since
4.4

The table cell format of a table cell in a document specifies the visual properties of the table cell.

The padding properties of a table cell are controlled by setLeftPadding(), setRightPadding(), setTopPadding(), and setBottomPadding(). All the paddings can be set at once using setPadding().

See also
QTextFormat QTextBlockFormat QTextTableFormat QTextCharFormat

Definition at line 898 of file qtextformat.h.

Constructors and Destructors

◆ QTextTableCellFormat() [1/2]

QTextTableCellFormat::QTextTableCellFormat ( )

Constructs a new table cell format object.

Since
4.4

Definition at line 3805 of file qtextformat.cpp.

3806  : QTextCharFormat()
3807 {
3809 }
QTextCharFormat()
Constructs a new character format object.
void setObjectType(int type)
Sets the text format&#39;s object type to type.
Definition: qtextformat.h:367

◆ QTextTableCellFormat() [2/2]

QTextTableCellFormat::QTextTableCellFormat ( const QTextFormat other)
explicitprotected

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

Warning
This function is not part of the public interface.

Definition at line 3821 of file qtextformat.cpp.

3822  : QTextCharFormat(fmt)
3823 {
3824 }
QTextCharFormat()
Constructs a new character format object.

Functions

◆ bottomPadding()

qreal QTextTableCellFormat::bottomPadding ( ) const
inline

Gets the bottom padding of the table cell.

Since
4.4
See also
setBottomPadding(), leftPadding(), rightPadding(), topPadding()

Definition at line 939 of file qtextformat.h.

Referenced by QTextHtmlExporter::emitTable(), and QTextOdfWriter::writeTableCellFormat().

940 {
942 }
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ isValid()

bool QTextTableCellFormat::isValid ( ) const
inline

Returns true if this table cell format is valid; otherwise returns false.

Since
4.4

Definition at line 903 of file qtextformat.h.

903 { return isTableCellFormat(); }
bool isTableCellFormat() const
Returns true if this text format is a TableCellFormat; otherwise returns false.
Definition: qtextformat.h:324

◆ leftPadding()

qreal QTextTableCellFormat::leftPadding ( ) const
inline

Gets the left padding of the table cell.

Since
4.4
See also
setLeftPadding(), rightPadding(), topPadding(), bottomPadding()

Definition at line 949 of file qtextformat.h.

Referenced by QTextHtmlExporter::emitTable(), and QTextOdfWriter::writeTableCellFormat().

950 {
952 }
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ rightPadding()

qreal QTextTableCellFormat::rightPadding ( ) const
inline

Gets the right padding of the table cell.

Since
4.4
See also
setRightPadding(), leftPadding(), topPadding(), bottomPadding()

Definition at line 959 of file qtextformat.h.

Referenced by QTextHtmlExporter::emitTable(), and QTextOdfWriter::writeTableCellFormat().

960 {
962 }
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.

◆ setBottomPadding()

void QTextTableCellFormat::setBottomPadding ( qreal  padding)
inline

Sets the bottom padding of the table cell.

Since
4.4
See also
bottomPadding(), setLeftPadding(), setRightPadding(), setTopPadding()

Definition at line 934 of file qtextformat.h.

Referenced by QTextHtmlImporter::processBlockNode().

935 {
937 }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setLeftPadding()

void QTextTableCellFormat::setLeftPadding ( qreal  padding)
inline

Sets the left padding of the table cell.

Since
4.4
See also
leftPadding(), setRightPadding(), setTopPadding(), setBottomPadding()

Definition at line 944 of file qtextformat.h.

Referenced by QTextHtmlImporter::processBlockNode().

945 {
947 }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setPadding()

void QTextTableCellFormat::setPadding ( qreal  padding)
inline

Sets the left, right, top, and bottom padding of the table cell.

Since
4.4
See also
setLeftPadding(), setRightPadding(), setTopPadding(), setBottomPadding()

Definition at line 964 of file qtextformat.h.

965 {
966  setTopPadding(padding);
967  setBottomPadding(padding);
968  setLeftPadding(padding);
969  setRightPadding(padding);
970 }
void setRightPadding(qreal padding)
Sets the right padding of the table cell.
Definition: qtextformat.h:954
void setLeftPadding(qreal padding)
Sets the left padding of the table cell.
Definition: qtextformat.h:944
void setBottomPadding(qreal padding)
Sets the bottom padding of the table cell.
Definition: qtextformat.h:934
void setTopPadding(qreal padding)
Sets the top padding of the table cell.
Definition: qtextformat.h:924

◆ setRightPadding()

void QTextTableCellFormat::setRightPadding ( qreal  padding)
inline

Sets the right padding of the table cell.

Since
4.4
See also
rightPadding(), setLeftPadding(), setTopPadding(), setBottomPadding()

Definition at line 954 of file qtextformat.h.

Referenced by QTextHtmlImporter::processBlockNode().

955 {
957 }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ setTopPadding()

void QTextTableCellFormat::setTopPadding ( qreal  padding)
inline

Sets the top padding of the table cell.

Since
4.4
See also
topPadding(), setLeftPadding(), setRightPadding(), setBottomPadding()

Definition at line 924 of file qtextformat.h.

Referenced by QTextHtmlImporter::processBlockNode().

925 {
927 }
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.

◆ topPadding()

qreal QTextTableCellFormat::topPadding ( ) const
inline

Gets the top padding of the table cell.

Since
4.4
See also
setTopPadding(), leftPadding(), rightPadding(), bottomPadding()

Definition at line 929 of file qtextformat.h.

Referenced by QTextHtmlExporter::emitTable(), and QTextOdfWriter::writeTableCellFormat().

930 {
932 }
qreal doubleProperty(int propertyId) const
Returns the value of the property specified by propertyId.

Friends and Related Functions

◆ QTextFormat

friend class QTextFormat
friend

Definition at line 921 of file qtextformat.h.


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