- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Friends

# QTextCharFormat Class Reference

Search for all occurrences

## Detailed Description

Definition at line 367 of file qtextformat.h.

`#include <qtextformat.h>`

Inheritance diagram for QTextCharFormat:
[legend]

List of all members.

## Public Types
enum | VerticalAlignment { AlignNormal = 0, AlignSuperScript, AlignSubScript, AlignMiddle, AlignTop, AlignBottom }
enum | UnderlineStyle { NoUnderline, SingleUnderline, DashUnderline, DotLine, DashDotLine, DashDotDotLine, WaveUnderline, SpellCheckUnderline }
## Public Member Functions
| QTextCharFormat ()
bool | isValid () const
void | setFont (const QFont &font)
QFont | font () const
void | setFontFamily (const QString &family)
QString | fontFamily () const
void | setFontPointSize (qreal size)
qreal | fontPointSize () const
void | setFontWeight (int weight)
int | fontWeight () const
void | setFontItalic (bool italic)
bool | fontItalic () const
void | setFontCapitalization (QFont::Capitalization capitalization)
QFont::Capitalization | fontCapitalization () const
void | setFontLetterSpacing (qreal spacing)
qreal | fontLetterSpacing () const
void | setFontWordSpacing (qreal spacing)
qreal | fontWordSpacing () const
void | setFontUnderline (bool underline)
bool | fontUnderline () const
void | setFontOverline (bool overline)
bool | fontOverline () const
void | setFontStrikeOut (bool strikeOut)
bool | fontStrikeOut () const
void | setUnderlineColor (const QColor &color)
QColor | underlineColor () const
void | setFontFixedPitch (bool fixedPitch)
bool | fontFixedPitch () const
void | setFontStyleHint (QFont::StyleHint hint, QFont::StyleStrategy strategy=QFont::PreferDefault)
void | setFontStyleStrategy (QFont::StyleStrategy strategy)
QFont::StyleHint | fontStyleHint () const
QFont::StyleStrategy | fontStyleStrategy () const
void | setFontKerning (bool enable)
bool | fontKerning () const
void | setUnderlineStyle (UnderlineStyle style)
UnderlineStyle | underlineStyle () const
void | setVerticalAlignment (VerticalAlignment alignment)
VerticalAlignment | verticalAlignment () const
void | setTextOutline (const QPen &pen)
QPen | textOutline () const
void | setToolTip (const QString &tip)
QString | toolTip () const
void | setAnchor (bool anchor)
bool | isAnchor () const
void | setAnchorHref (const QString &value)
QString | anchorHref () const
void | setAnchorName (const QString &name)
QString | anchorName () const
void | setAnchorNames (const QStringList &names)
QStringList | anchorNames () const
void | setTableCellRowSpan (int tableCellRowSpan)
int | tableCellRowSpan () const
void | setTableCellColumnSpan (int tableCellColumnSpan)
int | tableCellColumnSpan () const
## Protected Member Functions
| QTextCharFormat (const QTextFormat &fmt)
## Friends
class | QTextFormat

## Member Enumeration Documentation

enum VerticalAlignment

Search for all occurrences

Enumerator:

  AlignNormal | Search for all occurrences
  AlignSuperScript | Search for all occurrences
  AlignSubScript | Search for all occurrences
  AlignMiddle | Search for all occurrences
  AlignTop | Search for all occurrences
  AlignBottom | Search for all occurrences

Definition at line 370 of file qtextformat.h.

                               {
            AlignNormal = 0,
            AlignSuperScript,
            AlignSubScript,
            AlignMiddle,
            AlignTop,
            AlignBottom
        };

enum UnderlineStyle

Search for all occurrences

Enumerator:

  NoUnderline | Search for all occurrences
  SingleUnderline | Search for all occurrences
  DashUnderline | Search for all occurrences
  DotLine | Search for all occurrences
  DashDotLine | Search for all occurrences
  DashDotDotLine | Search for all occurrences
  WaveUnderline | Search for all occurrences
  SpellCheckUnderline | Search for all occurrences

Definition at line 378 of file qtextformat.h.

                            { // keep in sync with Qt::PenStyle!
            NoUnderline,
            SingleUnderline,
            DashUnderline,
            DotLine,
            DashDotLine,
            DashDotDotLine,
            WaveUnderline,
            SpellCheckUnderline
        };

## Constructor & Destructor Documentation

QTextCharFormat | ( |  | ) |

QTextCharFormat | ( | const QTextFormat & | fmt | ) | `[explicit, protected]`

## Member Function Documentation

bool isValid | ( |  | ) | const `[inline]`

Search for all occurrences

Reimplemented from QTextFormat.

Reimplemented in QTextImageFormat, and QTextTableCellFormat.

Definition at line 391 of file qtextformat.h.

    { return isCharFormat(); }

void setFont | ( | const QFont & | font | ) |

Search for all occurrences

QFont font | ( |  | ) | const

Search for all occurrences

void setFontFamily | ( | const QString & | family | ) | `[inline]`

Search for all occurrences

Definition at line 395 of file qtextformat.h.

        { setProperty(FontFamily, family); }

QString fontFamily | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 397 of file qtextformat.h.

        { return stringProperty(FontFamily); }

void setFontPointSize | ( | qreal | size | ) | `[inline]`

Search for all occurrences

Definition at line 400 of file qtextformat.h.

        { setProperty(FontPointSize, size); }

qreal fontPointSize | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 402 of file qtextformat.h.

        { return doubleProperty(FontPointSize); }

void setFontWeight | ( | int | weight | ) | `[inline]`

Search for all occurrences

Definition at line 405 of file qtextformat.h.

        { if (weight == QFont::Normal) weight = 0; setProperty(FontWeight, weight); }

int fontWeight | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 407 of file qtextformat.h.

        { int weight = intProperty(FontWeight); if (weight == 0) weight = QFont::Normal; return weight; }

void setFontItalic | ( | bool | italic | ) | `[inline]`

Search for all occurrences

Definition at line 409 of file qtextformat.h.

        { setProperty(FontItalic, italic); }

bool fontItalic | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 411 of file qtextformat.h.

        { return boolProperty(FontItalic); }

void setFontCapitalization | ( | QFont::Capitalization | capitalization | ) | `[inline]`

Search for all occurrences

Definition at line 413 of file qtextformat.h.

        { setProperty(FontCapitalization, capitalization); }

QFont::Capitalization fontCapitalization | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 415 of file qtextformat.h.

        { return static_cast<QFont::Capitalization>(intProperty(FontCapitalization)); }

void setFontLetterSpacing | ( | qreal | spacing | ) | `[inline]`

Search for all occurrences

Definition at line 417 of file qtextformat.h.

        { setProperty(FontLetterSpacing, spacing); }

qreal fontLetterSpacing | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 419 of file qtextformat.h.

        { return doubleProperty(FontLetterSpacing); }

void setFontWordSpacing | ( | qreal | spacing | ) | `[inline]`

Search for all occurrences

Definition at line 421 of file qtextformat.h.

        { setProperty(FontWordSpacing, spacing); }

qreal fontWordSpacing | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 423 of file qtextformat.h.

        { return doubleProperty(FontWordSpacing); }

void setFontUnderline | ( | bool | underline | ) | `[inline]`

Search for all occurrences

Definition at line 426 of file qtextformat.h.

        { setProperty(TextUnderlineStyle, underline ? SingleUnderline : NoUnderline); }

bool fontUnderline | ( |  | ) | const

Search for all occurrences

void setFontOverline | ( | bool | overline | ) | `[inline]`

Search for all occurrences

Definition at line 430 of file qtextformat.h.

        { setProperty(FontOverline, overline); }

bool fontOverline | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 432 of file qtextformat.h.

        { return boolProperty(FontOverline); }

void setFontStrikeOut | ( | bool | strikeOut | ) | `[inline]`

Search for all occurrences

Definition at line 435 of file qtextformat.h.

        { setProperty(FontStrikeOut, strikeOut); }

bool fontStrikeOut | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 437 of file qtextformat.h.

        { return boolProperty(FontStrikeOut); }

void setUnderlineColor | ( | const QColor & | color | ) | `[inline]`

Search for all occurrences

Definition at line 440 of file qtextformat.h.

        { setProperty(TextUnderlineColor, color); }

QColor underlineColor | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 442 of file qtextformat.h.

        { return colorProperty(TextUnderlineColor); }

void setFontFixedPitch | ( | bool | fixedPitch | ) | `[inline]`

Search for all occurrences

Definition at line 445 of file qtextformat.h.

        { setProperty(FontFixedPitch, fixedPitch); }

bool fontFixedPitch | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 447 of file qtextformat.h.

        { return boolProperty(FontFixedPitch); }

void setFontStyleHint | ( | QFont::StyleHint | hint,
|  | QFont::StyleStrategy | strategy = `QFont::PreferDefault`
| ) |  | `[inline]`

Search for all occurrences

Definition at line 450 of file qtextformat.h.

        { setProperty(FontStyleHint, hint); setProperty(FontStyleStrategy, strategy); }

void setFontStyleStrategy | ( | QFont::StyleStrategy | strategy | ) | `[inline]`

Search for all occurrences

Definition at line 452 of file qtextformat.h.

        { setProperty(FontStyleStrategy, strategy); }

QFont::StyleHint fontStyleHint | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 454 of file qtextformat.h.

        { return static_cast<QFont::StyleHint>(intProperty(FontStyleHint)); }

QFont::StyleStrategy fontStyleStrategy | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 456 of file qtextformat.h.

        { return static_cast<QFont::StyleStrategy>(intProperty(FontStyleStrategy)); }

void setFontKerning | ( | bool | enable | ) | `[inline]`

Search for all occurrences

Definition at line 459 of file qtextformat.h.

        { setProperty(FontKerning, enable); }

bool fontKerning | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 461 of file qtextformat.h.

        { return boolProperty(FontKerning); }

void setUnderlineStyle | ( | UnderlineStyle | style | ) |

Search for all occurrences

UnderlineStyle underlineStyle | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 465 of file qtextformat.h.

        { return static_cast<UnderlineStyle>(intProperty(TextUnderlineStyle)); }

void setVerticalAlignment | ( | VerticalAlignment | alignment | ) | `[inline]`

Search for all occurrences

Definition at line 468 of file qtextformat.h.

        { setProperty(TextVerticalAlignment, alignment); }

VerticalAlignment verticalAlignment | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 470 of file qtextformat.h.

        { return static_cast<VerticalAlignment>(intProperty(TextVerticalAlignment)); }

void setTextOutline | ( | const QPen & | pen | ) | `[inline]`

Search for all occurrences

Definition at line 473 of file qtextformat.h.

        { setProperty(TextOutline, pen); }

QPen textOutline | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 475 of file qtextformat.h.

        { return penProperty(TextOutline); }

void setToolTip | ( | const QString & | tip | ) | `[inline]`

Search for all occurrences

Definition at line 478 of file qtextformat.h.

        { setProperty(TextToolTip, tip); }

QString toolTip | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 480 of file qtextformat.h.

        { return stringProperty(TextToolTip); }

void setAnchor | ( | bool | anchor | ) | `[inline]`

Search for all occurrences

Definition at line 483 of file qtextformat.h.

        { setProperty(IsAnchor, anchor); }

bool isAnchor | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 485 of file qtextformat.h.

        { return boolProperty(IsAnchor); }

void setAnchorHref | ( | const QString & | value | ) | `[inline]`

Search for all occurrences

Definition at line 488 of file qtextformat.h.

        { setProperty(AnchorHref, value); }

QString anchorHref | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 490 of file qtextformat.h.

        { return stringProperty(AnchorHref); }

void setAnchorName | ( | const QString & | name | ) | `[inline]`

Search for all occurrences

Definition at line 493 of file qtextformat.h.

        { setAnchorNames(QStringList(name)); }

QString anchorName | ( |  | ) | const

Search for all occurrences

void setAnchorNames | ( | const QStringList & | names | ) | `[inline]`

Search for all occurrences

Definition at line 497 of file qtextformat.h.

        { setProperty(AnchorName, names); }

QStringList anchorNames | ( |  | ) | const

Search for all occurrences

void setTableCellRowSpan | ( | int | tableCellRowSpan | ) | `[inline]`

Search for all occurrences

Definition at line 513 of file qtextformat.h.

    {
        if (_tableCellRowSpan <= 1)
            clearProperty(TableCellRowSpan); // the getter will return 1 here.
        else
            setProperty(TableCellRowSpan, _tableCellRowSpan);
    }

int tableCellRowSpan | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 502 of file qtextformat.h.

        { int s = intProperty(TableCellRowSpan); if (s == 0) s = 1; return s; }

void setTableCellColumnSpan | ( | int | tableCellColumnSpan | ) | `[inline]`

Search for all occurrences

Definition at line 521 of file qtextformat.h.

    {
        if (_tableCellColumnSpan <= 1)
            clearProperty(TableCellColumnSpan); // the getter will return 1 here.
        else
            setProperty(TableCellColumnSpan, _tableCellColumnSpan);
    }

int tableCellColumnSpan | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 505 of file qtextformat.h.

        { int s = intProperty(TableCellColumnSpan); if (s == 0) s = 1; return s; }

## Friends And Related Function Documentation

friend class QTextFormat `[friend]`

Search for all occurrences

Reimplemented in QTextImageFormat, and QTextTableCellFormat.

Definition at line 510 of file qtextformat.h.

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

- QtGui/qtextformat.h

QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat
QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat QTextCharFormat