You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
144 lines
6.6 KiB
144 lines
6.6 KiB
13 years ago
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
5 months ago
|
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/dialogs/tqfontdialog.cpp:59 -->
|
||
13 years ago
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||
|
<title>TQFontDialog Class</title>
|
||
|
<style type="text/css"><!--
|
||
|
fn { margin-left: 1cm; text-indent: -1cm; }
|
||
|
a:link { color: #004faf; text-decoration: none }
|
||
|
a:visited { color: #672967; text-decoration: none }
|
||
|
body { background: #ffffff; color: black; }
|
||
|
--></style>
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||
|
<tr bgcolor="#E5E5E5">
|
||
|
<td valign=center>
|
||
|
<a href="index.html">
|
||
|
<font color="#004faf">Home</font></a>
|
||
|
| <a href="classes.html">
|
||
|
<font color="#004faf">All Classes</font></a>
|
||
|
| <a href="mainclasses.html">
|
||
|
<font color="#004faf">Main Classes</font></a>
|
||
|
| <a href="annotated.html">
|
||
|
<font color="#004faf">Annotated</font></a>
|
||
|
| <a href="groups.html">
|
||
|
<font color="#004faf">Grouped Classes</font></a>
|
||
|
| <a href="functions.html">
|
||
|
<font color="#004faf">Functions</font></a>
|
||
|
</td>
|
||
|
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQFontDialog Class Reference</h1>
|
||
|
|
||
|
<p>The TQFontDialog class provides a dialog widget for selecting a font.
|
||
|
<a href="#details">More...</a>
|
||
5 months ago
|
<p><tt>#include <<a href="tqfontdialog-h.html">tqfontdialog.h</a>></tt>
|
||
13 years ago
|
<p>Inherits <a href="ntqdialog.html">TQDialog</a>.
|
||
5 months ago
|
<p><a href="tqfontdialog-members.html">List of all member functions.</a>
|
||
13 years ago
|
<h2>Static Public Members</h2>
|
||
|
<ul>
|
||
|
<li class=fn>TQFont <a href="#getFont"><b>getFont</b></a> ( bool * ok, const TQFont & initial, TQWidget * parent = 0, const char * name = 0 )</li>
|
||
|
<li class=fn>TQFont <a href="#getFont-2"><b>getFont</b></a> ( bool * ok, TQWidget * parent = 0, const char * name = 0 )</li>
|
||
|
</ul>
|
||
|
<hr><a name="details"></a><h2>Detailed Description</h2>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
The TQFontDialog class provides a dialog widget for selecting a font.
|
||
|
<p> The usual way to use this class is to call one of the static convenience
|
||
|
functions, e.g. <a href="#getFont">getFont</a>().
|
||
|
<p> Examples:
|
||
|
<p> <pre>
|
||
|
bool ok;
|
||
5 months ago
|
<a href="tqfont.html">TQFont</a> font = TQFontDialog::<a href="#getFont">getFont</a>(
|
||
13 years ago
|
&ok, TQFont( "Helvetica [Cronyx]", 10 ), this );
|
||
|
if ( ok ) {
|
||
|
// font is set to the font the user selected
|
||
|
} else {
|
||
|
// the user canceled the dialog; font is set to the initial
|
||
|
// value, in this case Helvetica [Cronyx], 10
|
||
|
}
|
||
|
</pre>
|
||
|
|
||
|
<p> The dialog can also be used to set a widget's font directly:
|
||
|
<pre>
|
||
|
myWidget.setFont( TQFontDialog::<a href="#getFont">getFont</a>( 0, myWidget.font() ) );
|
||
|
</pre>
|
||
|
|
||
|
If the user clicks OK the font they chose will be used for myWidget,
|
||
|
and if they click Cancel the original font is used.
|
||
5 months ago
|
<p> <p>See also <a href="tqfont.html">TQFont</a>, <a href="tqfontinfo.html">TQFontInfo</a>, <a href="tqfontmetrics.html">TQFontMetrics</a>, and <a href="dialogs.html">Dialog Classes</a>.
|
||
13 years ago
|
|
||
5 months ago
|
<p> <img src=tqfontdlg-w.png>
|
||
13 years ago
|
|
||
|
<hr><h2>Member Function Documentation</h2>
|
||
5 months ago
|
<h3 class=fn><a href="tqfont.html">TQFont</a> <a name="getFont"></a>TQFontDialog::getFont ( bool * ok, const <a href="tqfont.html">TQFont</a> & initial, <a href="tqwidget.html">TQWidget</a> * parent = 0, const char * name = 0 )<tt> [static]</tt>
|
||
13 years ago
|
</h3>
|
||
|
Executes a modal font dialog and returns a font.
|
||
|
<p> If the user clicks OK, the selected font is returned. If the user
|
||
|
clicks Cancel, the <em>initial</em> font is returned.
|
||
|
<p> The dialog is called <em>name</em>, with the parent <em>parent</em>.
|
||
|
<em>initial</em> is the initially selected font.
|
||
|
If the <em>ok</em> parameter is not-null, <em>*</em><em>ok</em> is set to TRUE if the
|
||
|
user clicked OK, and set to FALSE if the user clicked Cancel.
|
||
|
<p> This static function is less flexible than the full TQFontDialog
|
||
|
object, but is convenient and easy to use.
|
||
|
<p> Examples:
|
||
|
<pre>
|
||
|
bool ok;
|
||
5 months ago
|
<a href="tqfont.html">TQFont</a> font = TQFontDialog::<a href="#getFont">getFont</a>( &ok, TQFont( "Times", 12 ), this );
|
||
13 years ago
|
if ( ok ) {
|
||
|
// font is set to the font the user selected
|
||
|
} else {
|
||
|
// the user canceled the dialog; font is set to the initial
|
||
|
// value, in this case Times, 12.
|
||
|
}
|
||
|
</pre>
|
||
|
|
||
|
<p> The dialog can also be used to set a widget's font directly:
|
||
|
<pre>
|
||
|
myWidget.setFont( TQFontDialog::<a href="#getFont">getFont</a>( 0, myWidget.font() ) );
|
||
|
</pre>
|
||
|
|
||
|
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.
|
||
|
|
||
|
<p>Examples: <a href="canvas-chart-example.html#x2881">chart/chartform.cpp</a>, <a href="tutorial2-09.html#x2638">chart/optionsform.cpp</a>, <a href="qfd-example.html#x1981">qfd/fontdisplayer.cpp</a>, <a href="qwerty-example.html#x368">qwerty/qwerty.cpp</a>, and <a href="xform-example.html#x1224">xform/xform.cpp</a>.
|
||
5 months ago
|
<h3 class=fn><a href="tqfont.html">TQFont</a> <a name="getFont-2"></a>TQFontDialog::getFont ( bool * ok, <a href="tqwidget.html">TQWidget</a> * parent = 0, const char * name = 0 )<tt> [static]</tt>
|
||
13 years ago
|
</h3>
|
||
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
||
|
<p> Executes a modal font dialog and returns a font.
|
||
|
<p> If the user clicks OK, the selected font is returned. If the user
|
||
|
clicks Cancel, the TQt default font is returned.
|
||
|
<p> The dialog is called <em>name</em>, with parent <em>parent</em>.
|
||
|
If the <em>ok</em> parameter is not-null, <em>*</em><em>ok</em> is set to TRUE if the
|
||
|
user clicked OK, and FALSE if the user clicked Cancel.
|
||
|
<p> This static function is less functional than the full TQFontDialog
|
||
|
object, but is convenient and easy to use.
|
||
|
<p> Example:
|
||
|
<pre>
|
||
|
bool ok;
|
||
5 months ago
|
<a href="tqfont.html">TQFont</a> font = TQFontDialog::<a href="#getFont">getFont</a>( &ok, this );
|
||
13 years ago
|
if ( ok ) {
|
||
|
// font is set to the font the user selected
|
||
|
} else {
|
||
|
// the user canceled the dialog; font is set to the default
|
||
6 months ago
|
// application font, TQApplication::<a href="tqwidget.html#font-prop">font</a>()
|
||
13 years ago
|
}
|
||
|
</pre>
|
||
|
|
||
|
<p>
|
||
|
<!-- eof -->
|
||
|
<hr><p>
|
||
|
This file is part of the <a href="index.html">TQt toolkit</a>.
|
||
|
Copyright © 1995-2007
|
||
|
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
||
|
<table width=100% cellspacing=0 border=0><tr>
|
||
|
<td>Copyright © 2007
|
||
|
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
||
|
<td align=right><div align=right>TQt 3.3.8</div>
|
||
|
</table></div></address></body>
|
||
|
</html>
|