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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | Friends

# QFont Class Reference

Search for all occurrences

## Detailed Description

Definition at line 64 of file qfont.h.

`#include <qfont.h>`

List of all members.

## Public Types
enum | StyleHint { Helvetica, SansSerif = Helvetica, Times, Serif = Times, Courier, TypeWriter = Courier, OldEnglish, Decorative = OldEnglish, System, AnyStyle, Cursive, Monospace, Fantasy }
enum | StyleStrategy { PreferDefault = 0x0001, PreferBitmap = 0x0002, PreferDevice = 0x0004, PreferOutline = 0x0008, ForceOutline = 0x0010, PreferMatch = 0x0020, PreferQuality = 0x0040, PreferAntialias = 0x0080, NoAntialias = 0x0100, OpenGLCompatible = 0x0200, ForceIntegerMetrics = 0x0400, NoFontMerging = 0x8000 }
enum | Weight { Light = 25, Normal = 50, DemiBold = 63, Bold = 75, Black = 87 }
enum | Style { StyleNormal, StyleItalic, StyleOblique }
enum | Stretch { UltraCondensed = 50, ExtraCondensed = 62, Condensed = 75, SemiCondensed = 87, Unstretched = 100, SemiExpanded = 112, Expanded = 125, ExtraExpanded = 150, UltraExpanded = 200 }
enum | Capitalization { MixedCase, AllUppercase, AllLowercase, SmallCaps, Capitalize }
enum | SpacingType { PercentageSpacing, AbsoluteSpacing }
enum | ResolveProperties { FamilyResolved = 0x0001, SizeResolved = 0x0002, StyleHintResolved = 0x0004, StyleStrategyResolved = 0x0008, WeightResolved = 0x0010, StyleResolved = 0x0020, UnderlineResolved = 0x0040, OverlineResolved = 0x0080, StrikeOutResolved = 0x0100, FixedPitchResolved = 0x0200, StretchResolved = 0x0400, KerningResolved = 0x0800, CapitalizationResolved = 0x1000, LetterSpacingResolved = 0x2000, WordSpacingResolved = 0x4000, AllPropertiesResolved = 0x7fff }
## Public Member Functions
| QFont ()
| QFont (const QString &family, int pointSize=-1, int weight=-1, bool italic=false)
| QFont (const QFont &, QPaintDevice *pd)
| QFont (const QFont &)
| ~QFont ()
QString | family () const
void | setFamily (const QString &)
int | pointSize () const
void | setPointSize (int)
qreal | pointSizeF () const
void | setPointSizeF (qreal)
int | pixelSize () const
void | setPixelSize (int)
int | weight () const
void | setWeight (int)
bool | bold () const
void | setBold (bool)
void | setStyle (Style style)
Style | style () const
bool | italic () const
void | setItalic (bool b)
bool | underline () const
void | setUnderline (bool)
bool | overline () const
void | setOverline (bool)
bool | strikeOut () const
void | setStrikeOut (bool)
bool | fixedPitch () const
void | setFixedPitch (bool)
bool | kerning () const
void | setKerning (bool)
StyleHint | styleHint () const
StyleStrategy | styleStrategy () const
void | setStyleHint (StyleHint, StyleStrategy=PreferDefault)
void | setStyleStrategy (StyleStrategy s)
int | stretch () const
void | setStretch (int)
qreal | letterSpacing () const
SpacingType | letterSpacingType () const
void | setLetterSpacing (SpacingType type, qreal spacing)
qreal | wordSpacing () const
void | setWordSpacing (qreal spacing)
void | setCapitalization (Capitalization)
Capitalization | capitalization () const
bool | rawMode () const
void | setRawMode (bool)
bool | exactMatch () const
QFont & | operator= (const QFont &)
bool | operator== (const QFont &) const
bool | operator!= (const QFont &) const
bool | operator< (const QFont &) const
| operator QVariant () const
bool | isCopyOf (const QFont &) const
Qt::HANDLE | handle () const
void | setRawName (const QString &)
QString | rawName () const
QString | key () const
QString | toString () const
bool | fromString (const QString &)
QString | defaultFamily () const
QString | lastResortFamily () const
QString | lastResortFont () const
QFont | resolve (const QFont &) const
uint | resolve () const
void | resolve (uint mask)
## Static Public Member Functions
static QString | substitute (const QString &)
static QStringList | substitutes (const QString &)
static QStringList | substitutions ()
static void | insertSubstitution (const QString &, const QString &)
static void | insertSubstitutions (const QString &, const QStringList &)
static void | removeSubstitution (const QString &)
static void | initialize ()
static void | cleanup ()
static void | cacheStatistics ()
## Friends
class | QFontPrivate
class | QFontDialogPrivate
class | QFontMetrics
class | QFontMetricsF
class | QFontInfo
class | QPainter
class | QPainterPrivate
class | QPSPrintEngineFont
class | QApplication
class | QWidget
class | QWidgetPrivate
class | Q3TextFormatCollection
class | QTextLayout
class | QTextEngine
class | QStackTextEngine
class | QTextLine
struct | QScriptLine
class | QGLContext
class | QWin32PaintEngine
class | QAlphaPaintEngine
class | QPainterPath
class | QTextItemInt
class | QPicturePaintEngine
class | QPainterReplayer
class | QPaintBufferEngine
class | QCommandLinkButtonPrivate
Q_GUI_EXPORT QDataStream & | operator<< (QDataStream &, const QFont &)
Q_GUI_EXPORT QDataStream & | operator>> (QDataStream &, QFont &)

## Member Enumeration Documentation

enum StyleHint

Search for all occurrences

Enumerator:

  Helvetica | Search for all occurrences
  SansSerif | Search for all occurrences
  Times | Search for all occurrences
  Serif | Search for all occurrences
  Courier | Search for all occurrences
  TypeWriter | Search for all occurrences
  OldEnglish | Search for all occurrences
  Decorative | Search for all occurrences
  System | Search for all occurrences
  AnyStyle | Search for all occurrences
  Cursive | Search for all occurrences
  Monospace | Search for all occurrences
  Fantasy | Search for all occurrences

Definition at line 69 of file qfont.h.

                       {
            Helvetica,  SansSerif = Helvetica,
            Times,      Serif = Times,
            Courier,    TypeWriter = Courier,
            OldEnglish, Decorative = OldEnglish,
            System,
            AnyStyle,
            Cursive,
            Monospace,
            Fantasy
        };

enum StyleStrategy

Search for all occurrences

Enumerator:

  PreferDefault | Search for all occurrences
  PreferBitmap | Search for all occurrences
  PreferDevice | Search for all occurrences
  PreferOutline | Search for all occurrences
  ForceOutline | Search for all occurrences
  PreferMatch | Search for all occurrences
  PreferQuality | Search for all occurrences
  PreferAntialias | Search for all occurrences
  NoAntialias | Search for all occurrences
  OpenGLCompatible | Search for all occurrences
  ForceIntegerMetrics | Search for all occurrences
  NoFontMerging | Search for all occurrences

Definition at line 81 of file qfont.h.

                           {
            PreferDefault       = 0x0001,
            PreferBitmap        = 0x0002,
            PreferDevice        = 0x0004,
            PreferOutline       = 0x0008,
            ForceOutline        = 0x0010,
            PreferMatch         = 0x0020,
            PreferQuality       = 0x0040,
            PreferAntialias     = 0x0080,
            NoAntialias         = 0x0100,
            OpenGLCompatible    = 0x0200,
            ForceIntegerMetrics = 0x0400,
            NoFontMerging       = 0x8000
        };

enum Weight

Search for all occurrences

Enumerator:

  Light | Search for all occurrences
  Normal | Search for all occurrences
  DemiBold | Search for all occurrences
  Bold | Search for all occurrences
  Black | Search for all occurrences

Definition at line 96 of file qfont.h.

                    {
            Light    = 25,
            Normal   = 50,
            DemiBold = 63,
            Bold     = 75,
            Black    = 87
        };

enum Style

Search for all occurrences

Enumerator:

  StyleNormal | Search for all occurrences
  StyleItalic | Search for all occurrences
  StyleOblique | Search for all occurrences

Definition at line 104 of file qfont.h.

                   {
            StyleNormal,
            StyleItalic,
            StyleOblique
        };

enum Stretch

Search for all occurrences

Enumerator:

  UltraCondensed | Search for all occurrences
  ExtraCondensed | Search for all occurrences
  Condensed | Search for all occurrences
  SemiCondensed | Search for all occurrences
  Unstretched | Search for all occurrences
  SemiExpanded | Search for all occurrences
  Expanded | Search for all occurrences
  ExtraExpanded | Search for all occurrences
  UltraExpanded | Search for all occurrences

Definition at line 110 of file qfont.h.

                     {
            UltraCondensed =  50,
            ExtraCondensed =  62,
            Condensed      =  75,
            SemiCondensed  =  87,
            Unstretched    = 100,
            SemiExpanded   = 112,
            Expanded       = 125,
            ExtraExpanded  = 150,
            UltraExpanded  = 200
        };

enum Capitalization

Search for all occurrences

Enumerator:

  MixedCase | Search for all occurrences
  AllUppercase | Search for all occurrences
  AllLowercase | Search for all occurrences
  SmallCaps | Search for all occurrences
  Capitalize | Search for all occurrences

Definition at line 122 of file qfont.h.

                            {
            MixedCase,
            AllUppercase,
            AllLowercase,
            SmallCaps,
            Capitalize
        };

enum SpacingType

Search for all occurrences

Enumerator:

  PercentageSpacing | Search for all occurrences
  AbsoluteSpacing | Search for all occurrences

Definition at line 130 of file qfont.h.

                         {
            PercentageSpacing,
            AbsoluteSpacing
        };

enum ResolveProperties

Search for all occurrences

Enumerator:

  FamilyResolved | Search for all occurrences
  SizeResolved | Search for all occurrences
  StyleHintResolved | Search for all occurrences
  StyleStrategyResolved | Search for all occurrences
  WeightResolved | Search for all occurrences
  StyleResolved | Search for all occurrences
  UnderlineResolved | Search for all occurrences
  OverlineResolved | Search for all occurrences
  StrikeOutResolved | Search for all occurrences
  FixedPitchResolved | Search for all occurrences
  StretchResolved | Search for all occurrences
  KerningResolved | Search for all occurrences
  CapitalizationResolved | Search for all occurrences
  LetterSpacingResolved | Search for all occurrences
  WordSpacingResolved | Search for all occurrences
  AllPropertiesResolved | Search for all occurrences

Definition at line 135 of file qfont.h.

                               {
            FamilyResolved         = 0x0001,
            SizeResolved           = 0x0002,
            StyleHintResolved      = 0x0004,
            StyleStrategyResolved  = 0x0008,
            WeightResolved         = 0x0010,
            StyleResolved          = 0x0020,
            UnderlineResolved      = 0x0040,
            OverlineResolved       = 0x0080,
            StrikeOutResolved      = 0x0100,
            FixedPitchResolved     = 0x0200,
            StretchResolved        = 0x0400,
            KerningResolved        = 0x0800,
            CapitalizationResolved = 0x1000,
            LetterSpacingResolved  = 0x2000,
            WordSpacingResolved    = 0x4000,
            AllPropertiesResolved  = 0x7fff
        };

## Constructor & Destructor Documentation

QFont | ( |  | ) |

QFont | ( | const QString & | family,
|  | int | pointSize = `-1`,
|  | int | weight = `-1`,
|  | bool | italic = `false`
| ) |  |

QFont | ( | const QFont & | ,
|  | QPaintDevice * | pd
| ) |  |

QFont | ( | const QFont & |  | ) |

~QFont | ( |  | ) |

## Member Function Documentation

QString family | ( |  | ) | const

Search for all occurrences

void setFamily | ( | const QString & |  | ) |

Search for all occurrences

int pointSize | ( |  | ) | const

Search for all occurrences

void setPointSize | ( | int |  | ) |

Search for all occurrences

qreal pointSizeF | ( |  | ) | const

Search for all occurrences

void setPointSizeF | ( | qreal |  | ) |

Search for all occurrences

int pixelSize | ( |  | ) | const

Search for all occurrences

void setPixelSize | ( | int |  | ) |

Search for all occurrences

int weight | ( |  | ) | const

Search for all occurrences

void setWeight | ( | int |  | ) |

Search for all occurrences

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

Search for all occurrences

Definition at line 329 of file qfont.h.

    { return weight() > Normal; }

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

Search for all occurrences

Definition at line 333 of file qfont.h.

    { setWeight(enable ? Bold : Normal); }

void setStyle | ( | Style | style | ) |

Search for all occurrences

Style style | ( |  | ) | const

Search for all occurrences

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

Search for all occurrences

Definition at line 336 of file qfont.h.

    {
        return (style() != StyleNormal);
    }

void setItalic | ( | bool | b | ) | `[inline]`

Search for all occurrences

Definition at line 341 of file qfont.h.

                                       {
        setStyle(b ? StyleItalic : StyleNormal);
    }

bool underline | ( |  | ) | const

Search for all occurrences

void setUnderline | ( | bool |  | ) |

Search for all occurrences

bool overline | ( |  | ) | const

Search for all occurrences

void setOverline | ( | bool |  | ) |

Search for all occurrences

bool strikeOut | ( |  | ) | const

Search for all occurrences

void setStrikeOut | ( | bool |  | ) |

Search for all occurrences

bool fixedPitch | ( |  | ) | const

Search for all occurrences

void setFixedPitch | ( | bool |  | ) |

Search for all occurrences

bool kerning | ( |  | ) | const

Search for all occurrences

void setKerning | ( | bool |  | ) |

Search for all occurrences

StyleHint styleHint | ( |  | ) | const

Search for all occurrences

StyleStrategy styleStrategy | ( |  | ) | const

Search for all occurrences

void setStyleHint | ( | StyleHint | ,
|  | StyleStrategy | = `PreferDefault`
| ) |  |

Search for all occurrences

void setStyleStrategy | ( | StyleStrategy | s | ) |

Search for all occurrences

int stretch | ( |  | ) | const

Search for all occurrences

void setStretch | ( | int |  | ) |

Search for all occurrences

qreal letterSpacing | ( |  | ) | const

Search for all occurrences

SpacingType letterSpacingType | ( |  | ) | const

Search for all occurrences

void setLetterSpacing | ( | SpacingType | type,
|  | qreal | spacing
| ) |  |

Search for all occurrences

qreal wordSpacing | ( |  | ) | const

Search for all occurrences

void setWordSpacing | ( | qreal | spacing | ) |

Search for all occurrences

void setCapitalization | ( | Capitalization |  | ) |

Search for all occurrences

Capitalization capitalization | ( |  | ) | const

Search for all occurrences

bool rawMode | ( |  | ) | const

Search for all occurrences

void setRawMode | ( | bool |  | ) |

Search for all occurrences

bool exactMatch | ( |  | ) | const

Search for all occurrences

QFont& operator= | ( | const QFont & |  | ) |

bool operator== | ( | const QFont & |  | ) | const

bool operator!= | ( | const QFont & |  | ) | const

bool operator< | ( | const QFont & |  | ) | const

operator QVariant | ( |  | ) | const

bool isCopyOf | ( | const QFont & |  | ) | const

Search for all occurrences

Qt::HANDLE handle | ( |  | ) | const

Search for all occurrences

void setRawName | ( | const QString & |  | ) |

Search for all occurrences

QString rawName | ( |  | ) | const

Search for all occurrences

QString key | ( |  | ) | const

Search for all occurrences

QString toString | ( |  | ) | const

Search for all occurrences

bool fromString | ( | const QString & |  | ) |

Search for all occurrences

static QString substitute | ( | const QString & |  | ) | `[static]`

Search for all occurrences

static QStringList substitutes | ( | const QString & |  | ) | `[static]`

Search for all occurrences

static QStringList substitutions | ( |  | ) | `[static]`

Search for all occurrences

static void insertSubstitution | ( | const QString & | ,
|  | const QString & |
| ) |  | `[static]`

Search for all occurrences

static void insertSubstitutions | ( | const QString & | ,
|  | const QStringList & |
| ) |  | `[static]`

Search for all occurrences

static void removeSubstitution | ( | const QString & |  | ) | `[static]`

Search for all occurrences

static void initialize | ( |  | ) | `[static]`

Search for all occurrences

static void cleanup | ( |  | ) | `[static]`

Search for all occurrences

static void cacheStatistics | ( |  | ) | `[static]`

Search for all occurrences

QString defaultFamily | ( |  | ) | const

Search for all occurrences

QString lastResortFamily | ( |  | ) | const

Search for all occurrences

QString lastResortFont | ( |  | ) | const

Search for all occurrences

QFont resolve | ( | const QFont & |  | ) | const

Search for all occurrences

uint resolve | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 269 of file qfont.h.

    { return resolve_mask; }

void resolve | ( | uint | mask | ) | `[inline]`

Search for all occurrences

Definition at line 270 of file qfont.h.

    { resolve_mask = mask; }

## Friends And Related Function Documentation

friend class QFontPrivate `[friend]`

Search for all occurrences

Definition at line 292 of file qfont.h.

friend class QFontDialogPrivate `[friend]`

Search for all occurrences

Definition at line 293 of file qfont.h.

friend class QFontMetrics `[friend]`

Search for all occurrences

Definition at line 294 of file qfont.h.

friend class QFontMetricsF `[friend]`

Search for all occurrences

Definition at line 295 of file qfont.h.

friend class QFontInfo `[friend]`

Search for all occurrences

Definition at line 296 of file qfont.h.

friend class QPainter `[friend]`

Search for all occurrences

Definition at line 297 of file qfont.h.

friend class QPainterPrivate `[friend]`

Search for all occurrences

Definition at line 298 of file qfont.h.

friend class QPSPrintEngineFont `[friend]`

Search for all occurrences

Definition at line 299 of file qfont.h.

friend class QApplication `[friend]`

Search for all occurrences

Definition at line 300 of file qfont.h.

friend class QWidget `[friend]`

Search for all occurrences

Definition at line 301 of file qfont.h.

friend class QWidgetPrivate `[friend]`

Search for all occurrences

Definition at line 302 of file qfont.h.

friend class Q3TextFormatCollection `[friend]`

Search for all occurrences

Definition at line 303 of file qfont.h.

friend class QTextLayout `[friend]`

Search for all occurrences

Definition at line 304 of file qfont.h.

friend class QTextEngine `[friend]`

Search for all occurrences

Definition at line 305 of file qfont.h.

friend class QStackTextEngine `[friend]`

Search for all occurrences

Definition at line 306 of file qfont.h.

friend class QTextLine `[friend]`

Search for all occurrences

Definition at line 307 of file qfont.h.

friend struct QScriptLine `[friend]`

Search for all occurrences

Definition at line 308 of file qfont.h.

friend class QGLContext `[friend]`

Search for all occurrences

Definition at line 309 of file qfont.h.

friend class QWin32PaintEngine `[friend]`

Search for all occurrences

Definition at line 310 of file qfont.h.

friend class QAlphaPaintEngine `[friend]`

Search for all occurrences

Definition at line 311 of file qfont.h.

friend class QPainterPath `[friend]`

Search for all occurrences

Definition at line 312 of file qfont.h.

friend class QTextItemInt `[friend]`

Search for all occurrences

Definition at line 313 of file qfont.h.

friend class QPicturePaintEngine `[friend]`

Search for all occurrences

Definition at line 314 of file qfont.h.

friend class QPainterReplayer `[friend]`

Search for all occurrences

Definition at line 315 of file qfont.h.

friend class QPaintBufferEngine `[friend]`

Search for all occurrences

Definition at line 316 of file qfont.h.

friend class QCommandLinkButtonPrivate `[friend]`

Search for all occurrences

Definition at line 317 of file qfont.h.

Q_GUI_EXPORT QDataStream& operator<< | ( | QDataStream & | ,
|  | const QFont & |
| ) |  | `[friend]`

Q_GUI_EXPORT QDataStream& operator>> | ( | QDataStream & | ,
|  | QFont & |
| ) |  | `[friend]`

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

- QtGui/qfont.h

QFont QFont QFont QFont QFont QFont QFont QFont QFont QFont
QFont QFont QFont QFont QFont QFont QFont QFont QFont QFont