📄 qfontdialog.3qt
字号:
'\" t.TH QFontDialog 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQFontDialog \- Dialog widget for selecting a font.SH SYNOPSIS\fC#include <qfontdialog.h>\fR.PPInherits QDialog..PP.SS "Static Public Members".TPQFont \fBgetFont\fR ( bool * ok, const QFont & initial, QWidget * parent = 0, const char * name = 0 ).TPQFont \fBgetFont\fR ( bool * ok, QWidget * parent = 0, const char * name = 0 ).SH DESCRIPTIONThe QFontDialog class provides a dialog widget for selecting a font..PPThe usual way to use this class is to call one of the static convenience functions, e.g. getFont()..PPExamples:.)l.PP.nf.br bool ok;.br QFont font = QFontDialog::getFont(.br &ok, QFont( "Helvetica [Cronyx]", 10 ), this );.br if ( ok ) {.br // font is set to the font the user selected.br } else {.br // the user cancelled the dialog; font is set to the initial.br // value, in this case Helvetica [Cronyx], 10.br }.br.fi.PPThe dialog can also be used to set a widget's font directly:.PP.nf.br myWidget.setFont( QFontDialog::getFont( 0, myWidget.font() ) );.br.fiIf the user clicks OK the font they chose will be used for myWidget, and if they click Cancel the original font is used..PPSee also QFont, QFontInfo, QFontMetrics, and Dialog Classes..PP.ce 1.B "[Image Omitted]".PP.SH MEMBER FUNCTION DOCUMENTATION.SH "QFont QFontDialog::getFont ( bool * ok, const QFont & initial, QWidget * parent = 0, const char * name = 0 )\fC [static]\fR"Executes a modal font dialog and returns a font..PPIf the user clicks OK, the selected font is returned. If the user clicks Cancel, the \fIinitial\fR font is returned..PPThe dialog is called \fIname\fR, with the parent \fIparent\fR. \fIinitial\fR is the initially selected font. If the \fIok\fR parameter is not-null, \fI*\fR\fIok\fR is set to TRUE if the user clicked OK, and set to FALSE if the user clicked Cancel..PPThis static function is less flexible than the full QFontDialog object, but is convenient and easy to use..PPExamples:.)l.PP.nf.br bool ok;.br QFont font = QFontDialog::getFont( &ok, QFont( "Times", 12 ), this );.br if ( ok ) {.br // font is set to the font the user selected.br } else {.br // the user cancelled the dialog; font is set to the initial.br // value, in this case Times, 12..br }.br.fi.PPThe dialog can also be used to set a widget's font directly:.PP.nf.br myWidget.setFont( QFontDialog::getFont( 0, myWidget.font() ) );.br.fiIn this example, if the user clicks OK the font they chose will be used, and if they click Cancel the original font is used..PPExamples:.)l chart/chartform.cpp, chart/optionsform.cpp, qfd/fontdisplayer.cpp, qwerty/qwerty.cpp, and xform/xform.cpp..SH "QFont QFontDialog::getFont ( bool * ok, QWidget * parent = 0, const char * name = 0 )\fC [static]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPExecutes a modal font dialog and returns a font..PPIf the user clicks OK, the selected font is returned. If the user clicks Cancel, the Qt default font is returned..PPThe dialog is called \fIname\fR, with parent \fIparent\fR. If the \fIok\fR parameter is not-null, \fI*\fR\fIok\fR is set to TRUE if the user clicked OK, and FALSE if the user clicked Cancel..PPThis static function is less functional than the full QFontDialog object, but is convenient and easy to use..PPExample:.PP.nf.br bool ok;.br QFont font = QFontDialog::getFont( &ok, this );.br if ( ok ) {.br // font is set to the font the user selected.br } else {.br // the user cancelled the dialog; font is set to the default.br // application font, QApplication::font().br }.br.fi.PP.SH "SEE ALSO".BR http://doc.trolltech.com/qfontdialog.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qfontdialog.3qt) and the Qtversion (3.1.1).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -