If the user clicks OK, the selected font is returned. If the user clicks Cancel, the \fIinitial\fR font is returned.
.PP
The 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.
.PP
This static function is less flexible than the full QFontDialog object, but is convenient and easy to use.
.PP
Examples:
.)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 canceled the dialog; font is set to the initial
.br
// value, in this case Times, 12.
.br
}
.br
.fi
.PP
The dialog can also be used to set a widget's font directly:
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Executes a modal font dialog and returns a font.
.PP
If the user clicks OK, the selected font is returned. If the user clicks Cancel, the Qt default font is returned.
.PP
The 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.
.PP
This static function is less functional than the full QFontDialog object, but is convenient and easy to use.
.PP
Example:
.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 canceled the dialog; font is set to the default