QFontInfo Class Reference
The QFontInfo class provides general information about fonts. More...
#include <QFontInfo>
Note: All functions in this class are reentrant.
Public Functions
Detailed Description.
- 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, and QFontDatabase.
Member Function Documentation
QFontInfo::QFontInfo ( const QFont & font ).
QFontInfo::QFontInfo ( const QFontInfo & fi )
Constructs a copy of fi.
QFontInfo::~QFontInfo ()
Destroys the font info object.
bool QFontInfo::bold () const
Returns true if weight() would return a value greater than QFont::Normal; otherwise returns false.
See also weight() and QFont::bold().
bool QFontInfo::exactMatch () const
Returns true if the matched window system font is exactly the same as the one specified by the font; otherwise returns false.
See also QFont::exactMatch().
QString QFontInfo::family () const
Returns the family name of the matched window system font.
See also QFont::family().
bool QFontInfo::fixedPitch () const
Returns the fixed pitch value of the matched window system font.
See also QFont::fixedPitch().
bool QFontInfo::italic () const
Returns the italic value of the matched window system font.
See also QFont::italic().
int QFontInfo::pixelSize () const
Returns the pixel size of the matched window system font.
See also QFont::pointSize().
int QFontInfo::pointSize () const
Returns the point size of the matched window system font.
See also pointSizeF() and QFont::pointSize().
qreal QFontInfo::pointSizeF () const
Returns the point size of the matched window system font.
See also QFont::pointSizeF().
bool QFontInfo::rawMode () const
Returns true if the font is a raw mode font; otherwise returns false.
If it is a raw mode font, all other functions in QFontInfo will return the same values set in the QFont, regardless of the font actually used.
See also QFont::rawMode().
QFont::Style QFontInfo::style () const
Returns the style value of the matched window system font.
See also QFont::style().
QFont::StyleHint QFontInfo::styleHint () const
Returns the style of the matched window system font.
Currently only returns the style hint set in QFont.
See also QFont::styleHint() and QFont::StyleHint.
QString QFontInfo::styleName () const
Returns the style name of the matched window system font on system that supports it.
This function was introduced in Qt 4.8.
See also QFont::styleName().
int QFontInfo::weight () const
Returns the weight of the matched window system font.
See also QFont::weight() and bold().
QFontInfo & QFontInfo::operator= ( const QFontInfo & fi )
Assigns the font info in fi.
No notes