qfont.3qt
来自「tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件」· 3QT 代码 · 共 707 行 · 第 1/2 页
3QT
707 行
Returns the character set by setCharSet()..PPUse QFontInfo to find the CharSet of the window system font actually used..PPSee also: setCharSet()..SH "void QFont::cleanup () \fC[static]\fR"Internal function that cleans up the font system..SH "int QFont::deciPointSize () const \fC[protected]\fR"Returns the point size in 1/10ths of a point..PPSee also: pointSize()..SH "QString QFont::defaultFamily () const \fC[protected]\fR"Returns the family name that corresponds to the current style hint..SH "const QFont QFont::defaultFont () \fC[static]\fR"Returns the QApplication default font..PPThis function will be removed in a future version of Qt. Please use QApplication::font() instead..SH "bool QFont::dirty () const \fC[protected]\fR"Returns TRUE if the font attributes have been changed and the font has to be (re)loaded, or FALSE if no changes have been made..SH "QString QFont::encodingName ( CharSet cs ) \fC[static]\fR"Returns the encoding name of a character set, e.g. QFont::ISO_8859_1 returns "iso8859-1" and QFont::Unicode returns "iso10646"..SH "bool QFont::exactMatch () const"Returns TRUE if a window system font exactly matching the settings of this font is available..PPSee also: QFontInfo and font matching.SH "QString QFont::family () const"Returns the family name set by setFamily()..PPUse QFontInfo to find the family name of the window system font that is actually used for drawing..PPExample:.PP.nf.br QFont font( "Nairobi" );.br QFontInfo info( font );.br qDebug( "Font family requested is : \\"%s\\"", font.family() );.br qDebug( "Font family actually used is: \\"%s\\"", info.family() );.fi.PPSee also: setFamily() and substitute()..SH "bool QFont::fixedPitch () const"Returns the value set by setFixedPitch()..PPUse QFontInfo to find the fixed pitch value of the window system font actually used..PPSee also: setFixedPitch() and QFontInfo::fixedPitch()..SH "void QFont::initialize () \fC[static]\fR"Internal function that initializes the font system..SH "void QFont::insertSubstitution ( const QString & familyName, const QString & replacementName ) \fC[static]\fR"Inserts a new font family name substitution in the family substitution table..PPIf \fIfamilyName\fR already exists in the substitution table, it will be replaced with this new substitution..PPSee also: removeSubstitution(), listSubstitutions() and substitute()..SH "bool QFont::isCopyOf ( const QFont & f ) const"Returns TRUE if this font and \fIf\fR are copies of each other, i.e. one of them was created as a copy of the other and neither was subsequently modified. This is much stricter than equality..PPSee also: operator= and operator==..SH "bool QFont::italic () const"Returns the value set by setItalic()..PPUse QFontInfo to find the italic value of the window system font actually used..PPSee also: setItalic()..SH "QString QFont::key () const"Returns the font's key, which is a textual representation of the font settings. It is typically used to insert and find fonts in a dictionary or a cache..PPSee also: QMap..SH "QString QFont::lastResortFamily () const \fC[protected]\fR"Returns a last resort family name for the font matching algorithm..PPSee also: lastResortFont()..SH "QString QFont::lastResortFont () const \fC[protected]\fR"Returns a last resort raw font name for the font matching algorithm..PPThis is used if not even the last resort family is available..PPSee also: lastResortFamily()..SH "void QFont::locale_init () \fC[static]\fR"Internal function that uses locale information to find the preferred character set of loaded fonts..SH "bool QFont::operator!= ( const QFont & f ) const"Returns TRUE if the this font is different from \fIf,\fR or FALSE if they are equal..PPTwo QFonts are different if their font attributes are different. If rawMode() is enabled for both fonts, then only the family fields are compared..PPSee also: operator==()..SH "QFont & QFont::operator= ( const QFont & font )"Assigns \fIfont\fR to this font and returns a reference to this font..SH "bool QFont::operator== ( const QFont & f ) const"Returns TRUE if the this font is equal to \fIf,\fR or FALSE if they are different..PPTwo QFonts are equal if their font attributes are equal. If rawMode() is enabled for both fonts, then only the family fields are compared..PPSee also: operator!=()..SH "int QFont::pixelSize () const"Returns the logical pixel height of characters in the font if shown on the screen..SH "int QFont::pointSize () const"Returns the point size set by setPointSize()..PPUse QFontInfo to find the point size of the window system font actually used..PPExample of use:.PP.nf.br QFont font( "helvetica" );.br QFontInfo info( font );.br font.setPointSize( 53 );.br qDebug( "Font size requested is : %d", font.pointSize() );.br qDebug( "Font size actually used is: %d", info.pointSize() );.fi.PPSee also: setPointSize() and deciPointSize()..SH "float QFont::pointSizeFloat () const"Returns the height of characters in the font in points (1/72 inch)..PPSee also: pointSize()..SH "bool QFont::rawMode () const"Returns the value set by setRawMode()..PPSee also: setRawMode()..SH "QString QFont::rawName () const"Returns the name of the font within the underlying window system. On Windows, this is usually just the family name of a true type font. Under X, it is a rather complex XLFD (X Logical Font Description). \fIUsing the return value of this function is usually not portable.\fR.PPSee also: setRawName()..SH "void QFont::removeSubstitution ( const QString & familyName ) \fC[static]\fR"Removes a font family name substitution from the family substitution table..PPSee also: insertSubstitution(), listSubstitutions() and substitute()..SH "void QFont::setBold ( bool enable )"Sets the weight to \fCQFont::Bold\fR if \fIenable\fR is TRUE, or to \fCQFont::Normal\fR if \fIenable\fR is FALSE..PPUse setWeight() to set the weight to other values..PPSee also: bold() and setWeight()..SH "void QFont::setCharSet ( CharSet charset )"Sets the character set encoding (e.g. \fCLatin1).\fR.PPIf the character set encoding is not available another will be used for drawing. for most non-trivial applications you will probably not want this to happen since it can totally obscure the text shown to the user. This is why the font matching algorithm gives high priority to finding the correct character set..PPYou can test that the character set is correct using the QFontInfo class..PPExample:.PP.nf.br QFont font( "times", 14 ); // default character set is Latin1.br QFontInfo info( font );.br if ( info.charSet() != Latin1 ) // check actual font.br qFatal( "Cannot find a Latin 1 Times font" );.fi.PPSee also: charSet(), QFontInfo and font matching.SH "void QFont::setDefaultFont ( const QFont & f ) \fC[static]\fR"\fBThis function is obsolete.\fR It is provided to keep old programs working. We strongly advise against using it in new code..PPSets the QApplication default font..PPThis function will be removed in a future version of Qt. Please use QApplication::setFont() instead..SH "void QFont::setFamily ( const QString & family )"Sets the family name of the font (e.g. "Helvetica" or "times")..PPThe family name is case insensitive..PPIf the family is not available a default family is used..PPSee also: family(), setStyleHint(), QFontInfo and font matching.SH "void QFont::setFixedPitch ( bool enable )"Sets fixed pitch on or off..PPA fixed pitch font is a font where all characters have the same width..PPSee also: fixedPitch(), QFontInfo and font matching.SH "void QFont::setItalic ( bool enable )"Sets italic on or off..PPSee also: italic(), QFontInfo and font matching.SH "void QFont::setPixelSize ( int pixelSize )"Sets the logical height of characters in the font if shown on the screen..SH "void QFont::setPixelSizeFloat ( float pixelSize )"Sets the logical pixel height of characters in the font if shown on the screen..SH "void QFont::setPointSize ( int pointSize )"Sets the point size to \fIpointSize.\fR The point size must be greater than zero..PPExample:.PP.nf.br QFont font( "courier" );.br font.setPointSize( 18 );.fi.PPSee also: pointSize(), QFontInfo and font matching.SH "void QFont::setPointSizeFloat ( float pointSize )"Sets the point size to \fIpointSize.\fR The point size must be greater than zero. The requested precision may not be achieved on all platforms..SH "void QFont::setRawName ( const QString & name )"Sets a font by its system specific name. The function is in particular useful under X, where system font settings ( for example X resources) are usually available as XLFD (X Logical Font Description) only. You can pass an XLFD as \fIname\fR to this function..PPThe big advantage over Qt-1.x' concept of raw fonts is, that a font after setRawName() is still a full-featured QFont. It can be queried (for example with italic()) or modified (for example with setItalic() ) and is therefore also suitable as a basis font for rendering rich text..PPIf Qt's internal font database cannot resolve the raw name, the font becomes a raw font with \fIname\fR as family..PPSee also: rawName(), setRawMode() and setFamily()..PPBugs and limitations:.TPDoesn't handle wildcards in XLFDs well, only complete descriptions. Aliases (file \fCfonts.alias\fR in the font directory on X11) are not supported..SH "void QFont::setStrikeOut ( bool enable )"Sets strike out on or off..PPSee also: strikeOut(), QFontInfo and font matching.SH "void QFont::setStyleHint ( StyleHint hint )"Sets the style hint..PPThe style hint has a default value of \fCAnyStyle\fR which leaves the task of finding a good default family to the font matching algorithm..PPIn the example below the push button will display its text label with the Bavaria font family if this family is available, if not it will display its text label with another serif font:.PP.nf.br #include <qapplication.h>.br #include <qpushbutton.h>.br #include <qfont.h>.br.br int main( int argc, char **argv ).br {.br QApplication app( argc, argv );.br QPushButton push("Push me");.br.br QFont font( "Bavaria", 18 ); // preferred family is Bavaria.br font.setStyleHint( QFont::Serif ); // can also use any serif font.br.br push.setFont( font );.br return app.exec( &push );.br }.fi.PPSee also: QFont::StyleHint, styleHint(), QFontInfo and font matching.PPExamples:.(ldesktop/desktop.cpp.)l.SH "void QFont::setUnderline ( bool enable )"Sets underline on or off..PPSee also: underline(), QFontInfo and font matching..SH "void QFont::setWeight ( int weight )"Sets the weight (or boldness), which should be a value from the QFont::Weight enumeration..PPExample:.PP.nf.br QFont font( "courier" );.br font.setWeight( QFont::Bold );.fi.PPStrictly speaking you can use all values in the range [0,99] (where 0 is ultralight and 99 is extremely black), but there is perhaps asking too much of the underlying window system..PPIf the specified weight is not available the closest available will be used. Use QFontInfo to check the actual weight..PPSee also: weight(), QFontInfo and font matching.SH "bool QFont::strikeOut () const"Returns the value set by setStrikeOut()..PPUse QFontInfo to find the strike out value of the window system font actually used..PPSee also: setStrikeOut() and QFontInfo::strikeOut()..SH "QFont::StyleHint QFont::styleHint() const"Returns the StyleHint set by setStyleHint()..PPSee also: setStyleHint() and QFontInfo::styleHint()..SH "QString QFont::substitute ( const QString & familyName ) \fC[static]\fR"Returns the font family name to be used whenever \fIfamilyName\fR is specified. The lookup is case insensitive..PPIf there is no substitution for \fIfamilyName,\fR then \fIfamilyName\fR is returned..PPExample:.PP.nf.br QFont::insertSubstitution( "NewYork", "London" );.br QFont::insertSubstitution( "Paris", "Texas" );.br.br QFont::substitute( "NewYork" ); // returns "London".br QFont::substitute( "PARIS" ); // returns "Texas".br QFont::substitute( "Rome" ); // returns "Rome".br.br QFont::removeSubstitution( "newyork" );.br QFont::substitute( "NewYork" ); // returns "NewYork".fi.PPSee also: setFamily(), insertSubstitution() and removeSubstitution()..SH "QStringList QFont::substitutions () \fC[static]\fR"Returns a sorted list of substituted family names..PPSee also: insertSubstitution(), removeSubstitution() and substitute()..SH "bool QFont::underline () const"Returns the value set by setUnderline()..PPUse QFontInfo to find the underline value of the window system font actually used for drawing..PPSee also: setUnderline() and QFontInfo::underline()..SH "int QFont::weight () const"Returns the weight set by setWeight()..PPUse QFontInfo to find the weight of the window system font actually used..PPSee also: setWeight() and QFontInfo..SH RELATED FUNCTION DOCUMENTATION.SH "QDataStream & operator<< (QDataStream & s, const QFont & f)"Writes a font to the stream..SH "QDataStream & operator>> (QDataStream & s, QFont & f)"Reads a font from the stream..SH "SEE ALSO".BR http://www.troll.no/qt/qfont.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS. See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?