Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 4670

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qabstractprintdialog.cpp -->
<head>
  <title>Qt 4.6: QPrintDialog Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QPrintDialog"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QPrintDialog Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</h1>
<p>The QPrintDialog class provides a dialog for specifying the printer's configuration. <a href="#details">More...</a></p>
<pre> #include &lt;QPrintDialog&gt;</pre><p>Inherits <a href="qabstractprintdialog.html">QAbstractPrintDialog</a>.</p>
<ul>
<li><a href="qprintdialog-members.html">List of all members, including inherited members</a></li>
<li><a href="qprintdialog-qt3.html">Qt 3 support members</a></li>
</ul>
<hr />
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li><div class="fn"><b><a href="qprintdialog.html#options-prop">options</a></b> : PrintDialogOptions</div></li>
</ul>
<ul>
<li><div bar="2" class="fn"></div>2 properties inherited from <a href="qdialog.html#properties">QDialog</a></li>
<li><div bar="2" class="fn"></div>58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#QPrintDialog">QPrintDialog</a></b> ( QPrinter * <i>printer</i>, QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#QPrintDialog-2">QPrintDialog</a></b> ( QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#dtor.QPrintDialog">~QPrintDialog</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#open">open</a></b> ( QObject * <i>receiver</i>, const char * <i>member</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">PrintDialogOptions </td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#options-prop">options</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QPrinter * </td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#printer">printer</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#setOption">setOption</a></b> ( PrintDialogOption <i>option</i>, bool <i>on</i> = true )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#options-prop">setOptions</a></b> ( PrintDialogOptions <i>options</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#testOption">testOption</a></b> ( PrintDialogOption <i>option</i> ) const</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#done">done</a></b> ( int <i>result</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#exec">exec</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#setVisible">setVisible</a></b> ( bool <i>visible</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>11 public functions inherited from <a href="qabstractprintdialog.html#public-functions">QAbstractPrintDialog</a></li>
<li><div bar="2" class="fn"></div>8 public functions inherited from <a href="qdialog.html#public-functions">QDialog</a></li>
<li><div bar="2" class="fn"></div>217 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<hr />
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qprintdialog.html#accepted">accepted</a></b> ( QPrinter * <i>printer</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>3 signals inherited from <a href="qdialog.html#signals">QDialog</a></li>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>5 public slots inherited from <a href="qdialog.html#public-slots">QDialog</a></li>
<li><div class="fn"></div>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li><div class="fn"></div>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>7 protected functions inherited from <a href="qdialog.html#protected-functions">QDialog</a></li>
<li><div class="fn"></div>37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li><div class="fn"></div>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QPrintDialog class provides a dialog for specifying the printer's configuration.</p>
<p>The dialog allows users to change document-related settings, such as the paper size and orientation, type of print (color or grayscale), range of pages, and number of copies to print.</p>
<p>Controls are also provided to enable users to choose from the printers available, including any configured network printers.</p>
<p>Typically, QPrintDialog objects are constructed with a <a href="qprinter.html">QPrinter</a> object, and executed using the <a href="qprintdialog.html#exec">exec</a>() function.</p>
<pre> QPrintDialog printDialog(printer, parent);
 if (printDialog.exec() == QDialog::Accepted) {
     <span class="comment">// print ...</span>
 }</pre>
<p>If the dialog is accepted by the user, the <a href="qprinter.html">QPrinter</a> object is correctly configured for printing.</p>
    <table align="center">
    <tr><td>
    <p><img src="images/plastique-printdialog.png" /></p>
    </td><td>
    <p><img src="images/plastique-printdialog-properties.png" /></p>
    </td></tr>
    </table>
    <p>The printer dialog (shown above in Plastique style) enables access to common printing properties. On X11 platforms that use the CUPS printing system, the settings for each available printer can be modified via the dialog's <b>Properties</b> push button.</p>
<p>On Windows and Mac OS X, the native print dialog is used, which means that some <a href="qwidget.html">QWidget</a> and <a href="qdialog.html">QDialog</a> properties set on the dialog won't be respected. The native print dialog on Mac OS X does not support setting printer options, i.e&#x2e; <a href="qprintdialog.html#options-prop">setOptions</a>() and <a href="qprintdialog.html#setOption">setOption</a>() have no effect.</p>
<p>In Qt 4.4, it was possible to use the static functions to show a sheet on Mac OS X. This is no longer supported in Qt 4.5&#x2e; If you want this functionality, use <a href="qprintdialog.html#open">QPrintDialog::open</a>().</p>
<p>See also <a href="qpagesetupdialog.html">QPageSetupDialog</a>, <a href="qprinter.html">QPrinter</a>, <a href="itemviews-pixelator.html">Pixelator Example</a>, <a href="richtext-orderform.html">Order Form Example</a>, <a href="widgets-imageviewer.html">Image Viewer Example</a>, and <a href="widgets-scribble.html">Scribble Example</a>.</p>
<hr />
<h2>Property Documentation</h2>
<a name="//apple_ref/cpp/instm/QPrintDialog/options"></a>
<a name="//apple_ref/cpp/instm/QPrintDialog/setOptions"></a>
<h3 class="fn"><a name="options-prop"></a>options : <a href="qabstractprintdialog.html#PrintDialogOption-enum">PrintDialogOptions</a></h3>
<p>This property holds the various options that affect the look and feel of the dialog.</p>
<p>By default, all options are disabled.</p>
<p>Options should be set before showing the dialog. Setting them while the dialog is visible is not guaranteed to have an immediate effect on the dialog (depending on the option and on the platform).</p>
<p>This property was introduced in Qt 4.5.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">PrintDialogOptions </td><td class="memItemRight" valign="bottom"><b>options</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setOptions</b> ( PrintDialogOptions <i>options</i> )</td></tr>
</table>
<p>See also <a href="qprintdialog.html#setOption">setOption</a>() and <a href="qprintdialog.html#testOption">testOption</a>().</p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QPrintDialog/QPrintDialog"></a>
<h3 class="fn"><a name="QPrintDialog"></a>QPrintDialog::QPrintDialog ( <a href="qprinter.html">QPrinter</a> * <i>printer</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a new modal printer dialog for the given <i>printer</i> with the given <i>parent</i>.</p>
<h3 class="fn"><a name="QPrintDialog-2"></a>QPrintDialog::QPrintDialog ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a print dialog with the given <i>parent</i>.</p>
<a name="//apple_ref/cpp/instm/QPrintDialog/~QPrintDialog"></a>
<h3 class="fn"><a name="dtor.QPrintDialog"></a>QPrintDialog::~QPrintDialog ()</h3>
<p>Destroys the print dialog.</p>
<a name="//apple_ref/cpp/instm/QPrintDialog/accepted"></a>
<h3 class="fn"><a name="accepted"></a>void QPrintDialog::accepted ( <a href="qprinter.html">QPrinter</a> * <i>printer</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the user accepts the values set in the print dialog. The <i>printer</i> parameter includes the printer that the settings were applied to.</p>
<a name="//apple_ref/cpp/instm/QPrintDialog/done"></a>
<h3 class="fn"><a name="done"></a>void QPrintDialog::done ( int <i>result</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qdialog.html#done">QDialog::done</a>().</p>
<p>Closes the dialog and sets its result code to <i>result</i>. If this dialog is shown with <a href="qprintdialog.html#exec">exec</a>(), done() causes the local event loop to finish, and <a href="qprintdialog.html#exec">exec</a>() to return <i>result</i>.</p>
<p>See also <a href="qdialog.html#done">QDialog::done</a>().</p>
<a name="//apple_ref/cpp/instm/QPrintDialog/exec"></a>
<h3 class="fn"><a name="exec"></a>int QPrintDialog::exec ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractprintdialog.html#exec">QAbstractPrintDialog::exec</a>().</p>
<a name="//apple_ref/cpp/instm/QPrintDialog/open"></a>
<h3 class="fn"><a name="open"></a>void QPrintDialog::open ( <a href="qobject.html">QObject</a> * <i>receiver</i>, const char * <i>member</i> )</h3>
<p>This is an overloaded function.</p>
<p>Opens the dialog and connects its <a href="qprintdialog.html#accepted">accepted</a>() signal to the slot specified by <i>receiver</i> and <i>member</i>.</p>
<p>The signal will be disconnected from the slot when the dialog is closed.</p>
<p>This function was introduced in Qt 4.5.</p>
<a name="//apple_ref/cpp/instm/QPrintDialog/printer"></a>
<h3 class="fn"><a name="printer"></a><a href="qprinter.html">QPrinter</a> * QPrintDialog::printer ()</h3>
<p>Returns the printer that this printer dialog operates on. This can be useful when using the <a href="qprintdialog.html#open">QPrintDialog::open</a>() method.</p>
<p>See also <a href="qprintdialog-qt3.html#setPrinter" class="compat">setPrinter</a>().</p>
<a name="//apple_ref/cpp/instm/QPrintDialog/setOption"></a>
<h3 class="fn"><a name="setOption"></a>void QPrintDialog::setOption ( <a href="qabstractprintdialog.html#PrintDialogOption-enum">PrintDialogOption</a> <i>option</i>, bool <i>on</i> = true )</h3>
<p>Sets the given <i>option</i> to be enabled if <i>on</i> is true; otherwise, clears the given <i>option</i>.</p>
<p>See also <a href="qprintdialog.html#options-prop">options</a> and <a href="qprintdialog.html#testOption">testOption</a>().</p>
<a name="//apple_ref/cpp/instm/QPrintDialog/setVisible"></a>
<h3 class="fn"><a name="setVisible"></a>void QPrintDialog::setVisible ( bool <i>visible</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#visible-prop">QWidget::setVisible</a>().</p>
<a name="//apple_ref/cpp/instm/QPrintDialog/testOption"></a>
<h3 class="fn"><a name="testOption"></a>bool QPrintDialog::testOption ( <a href="qabstractprintdialog.html#PrintDialogOption-enum">PrintDialogOption</a> <i>option</i> ) const</h3>
<p>Returns true if the given <i>option</i> is enabled; otherwise, returns false.</p>
<p>See also <a href="qprintdialog.html#options-prop">options</a> and <a href="qprintdialog.html#setOption">setOption</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>