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

QFont QFontDialog::getFont ( bool *  ok,
const QFont initial,
QWidget parent,
const QString caption 
) [static]

Executes a modal font dialog and returns a font.

If the user clicks OK, the selected font is returned. If the user clicks Cancel, the initial font is returned.

The dialog is constructed with the given parent. caption is shown as the window title of the dialog and initial is the initially selected font. If the ok parameter is not-null, the value it refers to is set to true if the user clicks OK, and set to false if the user clicks Cancel.

Examples: doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp 2

The dialog can also be used to set a widget's font directly: doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp 3 In this example, if the user clicks OK the font they chose will be used, and if they click Cancel the original font is used.

Definition at line 401 of file qfontdialog.cpp.

Referenced by getFont().

    return QFontDialogPrivate::getFont(ok, &initial, parent, caption);

Generated by  Doxygen 1.6.0   Back to index