1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
|
'\" t
.TH QFontDialog 3qt "18 March 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 NAME
QFontDialog \- Dialog widget for selecting a font
.SH SYNOPSIS
\fC#include <qfontdialog.h>\fR
.PP
Inherits QDialog.
.PP
.SS "Signals"
.TP
void \fBfontSelected\fR ( const QFont & font )
.TP
void \fBfontHighlighted\fR ( const QFont & font )
.SS "Static Public Members"
.TP
QFont \fBgetFont\fR ( bool * ok, const QFont & initial, QWidget * parent = 0, const char * name = 0 )
.TP
QFont \fBgetFont\fR ( bool * ok, QWidget * parent = 0, const char * name = 0 )
.SS "Protected Members"
.TP
virtual bool \fBeventFilter\fR ( QObject * o, QEvent * e )
.TP
QListBox * \fBfamilyListBox\fR () const
.TP
virtual void \fBupdateFamilies\fR ()
.TP
QListBox * \fBstyleListBox\fR () const
.TP
virtual void \fBupdateStyles\fR ()
.TP
QListBox * \fBsizeListBox\fR () const
.TP
virtual void \fBupdateSizes\fR ()
.TP
QComboBox * \fBscriptCombo\fR () const
.TP
virtual void \fBupdateScripts\fR ()
.SS "Protected Slots"
.TP
void \fBsizeChanged\fR ( const QString & s )
.SH DESCRIPTION
The QFontDialog class provides a dialog widget for selecting a font.
.PP
The usual way to use this class is to call one of the static convenience functions, getFont(), e.g.
.PP
Examples:
.)l
.PP
.nf
.br
bool ok;
.br
QFont font = QFontDialog::getFont( &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
.PP
The dialog can also be used to set a widget's font directly:
.PP
.nf
.br
aWidget.setFont( QFontDialog::getFont( 0, aWidget.font() ) );
.br
.fi
If the user clicks OK the font they chose will be used for aWidget, and if they click cancel the original font is kept.
.PP
See also QFont, QFontInfo, QFontMetrics and Dialog Classes.
.PP
.ce 1
.B "[Image Omitted]"
.PP
.ce 1
.B "[Image Omitted]"
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.SH "bool QFontDialog::eventFilter ( QObject * o, QEvent * e )\fC [virtual protected]\fR"
An event filter to make the Up, Down, PageUp and PageDown keys work correctly in the line edits. The source of the event is the object \fIo\fR and the event is \fIe\fR.
.SH "QListBox * QFontDialog::familyListBox () const\fC [protected]\fR"
Returns a pointer to the "font family" list box. This is mainly useful if you reimplement updateFontFamilies();
.SH "void QFontDialog::fontHighlighted ( const QFont & font )\fC [signal]\fR"
This signal is emitted when the user changed a setting in the dialog. The font that is highlighted is passed in \fIfont\fR.
.SH "void QFontDialog::fontSelected ( const QFont & font )\fC [signal]\fR"
This signal is emitted when the user has chosen a font and clicked OK. The font that was selected is passed in \fIfont\fR.
.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.
.PP
If the user clicks OK, the selected font is returned. If the user clicks Cancel, the \fIinitial\fR font is returned.
.PP
The dialog has parent \fIparent\fR and is called \fIname\fR. \fIinitial\fR is the initial 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 cancelled 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:
.PP
.nf
.br
myWidget.setFont( QFontDialog::getFont( 0, myWidget.font() ) );
.br
.fi
In this example, if the user clicks OK the font they chose will be used, and if they click cancel the original font is kept.
.PP
Examples:
.)l 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.
.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 has parent \fIparent\fR and is called \fIname\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 cancelled the dialog; font is set to the default
.br
// application font, QApplication::font()
.br
}
.br
.fi
.SH "QComboBox * QFontDialog::scriptCombo () const\fC [protected]\fR"
Returns a pointer to the "font style" list box. This is mainly useful if you reimplement updateFontStyles();
.SH "void QFontDialog::sizeChanged ( const QString & s )\fC [protected slot]\fR"
This slot is called if the user changes the font size. The size is passed in the \fIs\fR argument as a \fIstring\fR.
.SH "QListBox * QFontDialog::sizeListBox () const\fC [protected]\fR"
Returns a pointer to the "font size" list box. This is mainly useful if you reimplement updateFontSizes();
.SH "QListBox * QFontDialog::styleListBox () const\fC [protected]\fR"
Returns a pointer to the "font style" list box. This is mainly useful if you reimplement updateFontStyles();
.SH "void QFontDialog::updateFamilies ()\fC [virtual protected]\fR"
Updates the contents of the "font family" list box. This function can be reimplemented if you have special requirements.
.SH "void QFontDialog::updateScripts ()\fC [virtual protected]\fR"
Updates the contents of the "font script" combo box. This function can be reimplemented if you have special requirements.
.SH "void QFontDialog::updateSizes ()\fC [virtual protected]\fR"
Updates the contents of the "font size" list box. This function can be reimplemented if you have special requirements.
.SH "void QFontDialog::updateStyles ()\fC [virtual protected]\fR"
Updates the contents of the "font style" list box. This
function can be reimplemented if you have special requirements.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qfontdialog.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If 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.
.P
The definitive Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If 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 Qt
version (3.0.3).
|