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

QFontInfo Class Reference

List of all members.


Detailed Description

The QFontInfo class provides general information about fonts.

The QFontInfo class provides the same access functions as QFont, e.g. family(), pointSize(), italic(), weight(), fixedPitch(), styleHint() etc. But whilst the QFont access functions return the values that were set, a QFontInfo object returns the values that apply to the font that will actually be used to draw the text.

For example, when the program asks for a 25pt Courier font on a machine that has a non-scalable 24pt Courier font, QFont will (normally) use the 24pt Courier for rendering. In this case, QFont::pointSize() returns 25 and QFontInfo::pointSize() returns 24.

There are three ways to create a QFontInfo object. 1 Calling the QFontInfo constructor with a QFont creates a font info object for a screen-compatible font, i.e. the font cannot be a printer font. If the font is changed later, the font info object is not updated.

(Note: If you use a printer font the values returned may be inaccurate. Printer fonts are not always accessible so the nearest screen font is used if a printer font is supplied.)

QWidget::fontInfo() returns the font info for a widget's font. This is equivalent to calling QFontInfo(widget->font()). If the widget's font is changed later, the font info object is not updated.

QPainter::fontInfo() returns the font info for a painter's current font. If the painter's font is changed later, the font info object is not updated.

See also:
QFont QFontMetrics QFontDatabase

Definition at line 55 of file qfontinfo.h.


Public Member Functions

bool bold () const
bool exactMatch () const
QString family () const
bool fixedPitch () const
bool italic () const
QFontInfooperator= (const QFontInfo &)
bool overline () const
int pixelSize () const
int pointSize () const
qreal pointSizeF () const
 QFontInfo (const QFontInfo &)
 QFontInfo (const QFont &)
bool rawMode () const
bool strikeOut () const
QFont::Style style () const
QFont::StyleHint styleHint () const
bool underline () const
int weight () const
 ~QFontInfo ()

Private Attributes

QFontPrivate * d

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

Generated by  Doxygen 1.6.0   Back to index