Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QTextCharFormat Class Reference

Inheritance diagram for QTextCharFormat:

QTextFormat QTextImageFormat

List of all members.

Detailed Description

The QTextCharFormat class provides formatting information for characters in a QTextDocument.

The character format of text in a document specifies the visual properties of the text, as well as information about its role in a hypertext document.

The font used can be set by supplying a font to the setFont() function, and each aspect of its appearance can be adjusted to give the desired effect. setFontFamily() and setFontPointSize() define the font's family (e.g. Times) and printed size; setFontWeight() and setFontItalic() provide control over the style of the font. setFontUnderline(), setFontOverline(), setFontStrikeOut(), and setFontFixedPitch() provide additional effects for text.

The color is set with setForeground(). If the text is intended to be used as an anchor (for hyperlinks), this can be enabled with setAnchor(). The setAnchorHref() and setAnchorName() functions are used to specify the information about the hyperlink's destination and the anchor's name.

If the text is written within a table, it can be made to span a number of rows and columns with the setTableCellRowSpan() and setTableCellColumnSpan() functions.

See also:
QTextFormat QTextBlockFormat QTextTableFormat QTextListFormat

Definition at line 309 of file qtextformat.h.

Public Types

enum  FormatType {
  InvalidFormat = -1, BlockFormat = 1, CharFormat = 2, ListFormat = 3,
  TableFormat = 4, FrameFormat = 5, UserFormat = 100
enum  ObjectTypes { NoObject, ImageObject, TableObject, UserObject = 0x1000 }
enum  PageBreakFlag { PageBreak_Auto = 0, PageBreak_AlwaysBefore = 0x001, PageBreak_AlwaysAfter = 0x010 }
enum  Property {
  ObjectIndex = 0x0, CssFloat = 0x0800, LayoutDirection = 0x0801, OutlinePen = 0x810,
  BackgroundBrush = 0x820, ForegroundBrush = 0x821, BlockAlignment = 0x1010, BlockTopMargin = 0x1030,
  BlockBottomMargin = 0x1031, BlockLeftMargin = 0x1032, BlockRightMargin = 0x1033, TextIndent = 0x1034,
  BlockIndent = 0x1040, BlockNonBreakableLines = 0x1050, BlockTrailingHorizontalRulerWidth = 0x1060, FontFamily = 0x2000,
  FontPointSize = 0x2001, FontSizeAdjustment = 0x2002, FontSizeIncrement = FontSizeAdjustment, FontWeight = 0x2003,
  FontItalic = 0x2004, FontUnderline = 0x2005, FontOverline = 0x2006, FontStrikeOut = 0x2007,
  FontFixedPitch = 0x2008, FontPixelSize = 0x2009, TextUnderlineColor = 0x2010, TextVerticalAlignment = 0x2021,
  TextOutline = 0x2022, TextUnderlineStyle = 0x2023, IsAnchor = 0x2030, AnchorHref = 0x2031,
  AnchorName = 0x2032, ObjectType = 0x2f00, ListStyle = 0x3000, ListIndent = 0x3001,
  FrameBorder = 0x4000, FrameMargin = 0x4001, FramePadding = 0x4002, FrameWidth = 0x4003,
  FrameHeight = 0x4004, TableColumns = 0x4100, TableColumnWidthConstraints = 0x4101, TableCellSpacing = 0x4102,
  TableCellPadding = 0x4103, TableHeaderRowCount = 0x4104, TableCellRowSpan = 0x4810, TableCellColumnSpan = 0x4811,
  ImageName = 0x5000, ImageWidth = 0x5010, ImageHeight = 0x5011, FullWidthSelection = 0x06000,
  PageBreakPolicy = 0x7000, UserProperty = 0x100000
enum  UnderlineStyle {
  NoUnderline, SingleUnderline, DashUnderline, DotLine,
  DashDotLine, DashDotDotLine, WaveUnderline, SpellCheckUnderline
enum  VerticalAlignment { AlignNormal = 0, AlignSuperScript, AlignSubScript }

Public Member Functions

QString anchorHref () const
QString anchorName () const
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
QFont font () const
QString fontFamily () const
bool fontFixedPitch () const
bool fontItalic () const
bool fontOverline () const
qreal fontPointSize () const
bool fontStrikeOut () const
bool fontUnderline () const
int fontWeight () const
QBrush foreground () const
bool hasProperty (int propertyId) const
int intProperty (int propertyId) const
bool isAnchor () const
bool isBlockFormat () const
bool isCharFormat () const
bool isFrameFormat () const
bool isImageFormat () const
bool isListFormat () const
bool isTableFormat () const
bool isValid () const
Qt::LayoutDirection layoutDirection () const
QTextLength lengthProperty (int propertyId) const
QVector< QTextLengthlengthVectorProperty (int propertyId) const
void merge (const QTextFormat &other)
int objectIndex () const
int objectType () const
 operator QVariant () const
bool operator!= (const QTextFormat &rhs) const
bool operator== (const QTextFormat &rhs) const
QPen penProperty (int propertyId) const
QMap< int, QVariantproperties () const
QVariant property (int propertyId) const
 QTextCharFormat ()
void setAnchor (bool anchor)
void setAnchorHref (const QString &value)
void setAnchorName (const QString &name)
void setBackground (const QBrush &brush)
void setFont (const QFont &font)
void setFontFamily (const QString &family)
void setFontFixedPitch (bool fixedPitch)
void setFontItalic (bool italic)
void setFontOverline (bool overline)
void setFontPointSize (qreal size)
void setFontStrikeOut (bool strikeOut)
void setFontUnderline (bool underline)
void setFontWeight (int weight)
void setForeground (const QBrush &brush)
void setLayoutDirection (Qt::LayoutDirection direction)
void setObjectIndex (int object)
void setObjectType (int type)
void setProperty (int propertyId, const QVector< QTextLength > &lengths)
void setProperty (int propertyId, const QVariant &value)
void setTableCellColumnSpan (int tableCellColumnSpan)
void setTableCellRowSpan (int tableCellRowSpan)
void setTextOutline (const QPen &pen)
void setUnderlineColor (const QColor &color)
void setUnderlineStyle (UnderlineStyle style)
void setVerticalAlignment (VerticalAlignment alignment)
QString stringProperty (int propertyId) const
int tableCellColumnSpan () const
int tableCellRowSpan () const
QPen textOutline () const
QTextBlockFormat toBlockFormat () const
QTextCharFormat toCharFormat () const
QTextFrameFormat toFrameFormat () const
QTextImageFormat toImageFormat () const
QTextListFormat toListFormat () const
QTextTableFormat toTableFormat () const
int type () const
QColor underlineColor () const
UnderlineStyle underlineStyle () const
VerticalAlignment verticalAlignment () const

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

Generated by  Doxygen 1.6.0   Back to index