Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 2180

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qabstractprintdialog.cpp -->
  <title>QPrintDialog Class | Qt Print Support 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtprintsupport-index.html">Qt Print Support</a></td><td ><a href="qtprintsupport-module.html">C++ Classes</a></td><td >QPrintDialog</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QPrintDialog Class</h1>
<!-- $$$QPrintDialog-brief -->
<p>The <a href="qprintdialog.html">QPrintDialog</a> class provides a dialog for specifying the printer's configuration. <a href="#details">More...</a></p>
<!-- @@@QPrintDialog -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QPrintDialog&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += printsupport</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qabstractprintdialog.html">QAbstractPrintDialog</a></td></tr></table></div><ul>
<li><a href="qprintdialog-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qprintdialog.html#options-prop">options</a></b> : PrintDialogOptions</li>
</ul>
<ul>
<li class="fn">2 properties inherited from <a href="../qtwidgets/qdialog.html#properties">QDialog</a></li>
<li class="fn">59 properties inherited from <a href="../qtwidgets/qwidget.html#properties">QWidget</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#QPrintDialog">QPrintDialog</a></b>(QPrinter *<i>printer</i>, QWidget *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#QPrintDialog-1">QPrintDialog</a></b>(QWidget *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#dtor.QPrintDialog">~QPrintDialog</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#open">open</a></b>(QObject *<i>receiver</i>, const char *<i>member</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> PrintDialogOptions </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#options-prop">options</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPrinter *</td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#printer">printer</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#setOption">setOption</a></b>(PrintDialogOption <i>option</i>, bool <i>on</i> = true)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#options-prop">setOptions</a></b>(PrintDialogOptions <i>options</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#testOption">testOption</a></b>(PrintDialogOption <i>option</i>) const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#done">done</a></b>(int <i>result</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#exec">exec</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#setVisible">setVisible</a></b>(bool <i>visible</i>)</td></tr>
</table></div>
<ul>
<li class="fn">11 public functions inherited from <a href="qabstractprintdialog.html#public-functions">QAbstractPrintDialog</a></li>
<li class="fn">8 public functions inherited from <a href="../qtwidgets/qdialog.html#public-functions">QDialog</a></li>
<li class="fn">216 public functions inherited from <a href="../qtwidgets/qwidget.html#public-functions">QWidget</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintdialog.html#accepted">accepted</a></b>(QPrinter *<i>printer</i>)</td></tr>
</table></div>
<ul>
<li class="fn">3 signals inherited from <a href="../qtwidgets/qdialog.html#signals">QDialog</a></li>
<li class="fn">3 signals inherited from <a href="../qtwidgets/qwidget.html#signals">QWidget</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">5 public slots inherited from <a href="../qtwidgets/qdialog.html#public-slots">QDialog</a></li>
<li class="fn">19 public slots inherited from <a href="../qtwidgets/qwidget.html#public-slots">QWidget</a></li>
<li class="fn">5 static public members inherited from <a href="../qtwidgets/qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">6 protected functions inherited from <a href="../qtwidgets/qdialog.html#protected-functions">QDialog</a></li>
<li class="fn">35 protected functions inherited from <a href="../qtwidgets/qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">1 protected slot inherited from <a href="../qtwidgets/qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QPrintDialog-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qprintdialog.html">QPrintDialog</a> 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, <a href="qprintdialog.html">QPrintDialog</a> 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 class="cpp">

  <span class="type"><a href="qprintdialog.html#QPrintDialog">QPrintDialog</a></span> printDialog(printer<span class="operator">,</span> parent);
  <span class="keyword">if</span> (printDialog<span class="operator">.</span>exec() <span class="operator">=</span><span class="operator">=</span> <span class="type"><a href="../qtwidgets/qdialog.html#QDialog-1">QDialog</a></span><span class="operator">::</span>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>
<div class="table"><table class="generic">
 <tr valign="top" class="odd"><td ><img src="images/plastique-printdialog.png" alt="" /></td><td ><img src="images/plastique-printdialog-properties.png" alt="" /></td></tr>
</table></div>
<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 macOS, the native print dialog is used, which means that some <a href="../qtwidgets/qwidget.html">QWidget</a> and <a href="../qtwidgets/qdialog.html">QDialog</a> properties set on the dialog won't be respected. The native print dialog on macOS 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 macOS. 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>
</div>
<p><b>See also </b><a href="qpagesetupdialog.html">QPageSetupDialog</a> and <a href="qprinter.html">QPrinter</a>.</p>
<!-- @@@QPrintDialog -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$options-prop$$$options$$$setOptionsPrintDialogOptions -->
<h3 class="fn" id="options-prop"><a name="options-prop"></a><span class="name">options</span> : <span class="type"><a href="qabstractprintdialog.html#PrintDialogOption-enum">PrintDialogOptions</a></span></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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> PrintDialogOptions </td><td class="memItemRight bottomAlign"><span class="name"><b>options</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setOptions</b></span>(PrintDialogOptions <i>options</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qprintdialog.html#setOption">setOption</a>() and <a href="qprintdialog.html#testOption">testOption</a>().</p>
<!-- @@@options -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPrintDialog[overload1]$$$QPrintDialogQPrinter*QWidget* -->
<h3 class="fn" id="QPrintDialog"><a name="QPrintDialog"></a>QPrintDialog::<span class="name">QPrintDialog</span>(<span class="type"><a href="qprinter.html">QPrinter</a></span> *<i>printer</i>, <span class="type"><a href="../qtwidgets/qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a new modal printer dialog for the given <i>printer</i> with the given <i>parent</i>.</p>
<!-- @@@QPrintDialog -->
<!-- $$$QPrintDialog$$$QPrintDialogQWidget* -->
<h3 class="fn" id="QPrintDialog-1"><a name="QPrintDialog-1"></a>QPrintDialog::<span class="name">QPrintDialog</span>(<span class="type"><a href="../qtwidgets/qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Default constructs an instance of QPrintDialog.</p><!-- @@@QPrintDialog -->
<!-- $$$~QPrintDialog[overload1]$$$~QPrintDialog -->
<h3 class="fn" id="dtor.QPrintDialog"><a name="dtor.QPrintDialog"></a>QPrintDialog::<span class="name">~QPrintDialog</span>()</h3>
<p>Destroys the print dialog.</p>
<!-- @@@~QPrintDialog -->
<!-- $$$accepted[overload1]$$$acceptedQPrinter* -->
<h3 class="fn" id="accepted"><a name="accepted"></a><code>[signal] </code><span class="type">void</span> QPrintDialog::<span class="name">accepted</span>(<span class="type"><a href="qprinter.html">QPrinter</a></span> *<i>printer</i>)</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>
<!-- @@@accepted -->
<!-- $$$done[overload1]$$$doneint -->
<h3 class="fn" id="done"><a name="done"></a><code>[virtual] </code><span class="type">void</span> QPrintDialog::<span class="name">done</span>(<span class="type">int</span> <i>result</i>)</h3>
<p>Reimplemented from <a href="../qtwidgets/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><b>Note: </b>This function does not apply to the Native Print Dialog on the Mac macOS and Windows platforms, because the dialog is required to be modal and only the user can close it.</p><p><b>See also </b><a href="../qtwidgets/qdialog.html#done">QDialog::done</a>().</p>
<!-- @@@done -->
<!-- $$$exec[overload1]$$$exec -->
<h3 class="fn" id="exec"><a name="exec"></a><code>[virtual] </code><span class="type">int</span> QPrintDialog::<span class="name">exec</span>()</h3>
<p>Reimplemented from <a href="../qtwidgets/qdialog.html#exec">QDialog::exec</a>().</p>
<!-- @@@exec -->
<!-- $$$open[overload1]$$$openQObject*constchar* -->
<h3 class="fn" id="open"><a name="open"></a><span class="type">void</span> QPrintDialog::<span class="name">open</span>(<span class="type"><a href="../qtcore/qobject.html">QObject</a></span> *<i>receiver</i>, const <span class="type">char</span> *<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>
<!-- @@@open -->
<!-- $$$printer[overload1]$$$printer -->
<h3 class="fn" id="printer"><a name="printer"></a><span class="type"><a href="qprinter.html">QPrinter</a></span> *QPrintDialog::<span class="name">printer</span>()</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>
<!-- @@@printer -->
<!-- $$$setOption[overload1]$$$setOptionPrintDialogOptionbool -->
<h3 class="fn" id="setOption"><a name="setOption"></a><span class="type">void</span> QPrintDialog::<span class="name">setOption</span>(<span class="type"><a href="qabstractprintdialog.html#PrintDialogOption-enum">PrintDialogOption</a></span> <i>option</i>, <span class="type">bool</span> <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><b>See also </b><a href="qprintdialog.html#options-prop">options</a> and <a href="qprintdialog.html#testOption">testOption</a>().</p>
<!-- @@@setOption -->
<!-- $$$setVisible[overload1]$$$setVisiblebool -->
<h3 class="fn" id="setVisible"><a name="setVisible"></a><code>[virtual] </code><span class="type">void</span> QPrintDialog::<span class="name">setVisible</span>(<span class="type">bool</span> <i>visible</i>)</h3>
<p>Reimplemented from <a href="../qtwidgets/qwidget.html#visible-prop">QWidget::setVisible</a>().</p>
<!-- @@@setVisible -->
<!-- $$$testOption[overload1]$$$testOptionPrintDialogOption -->
<h3 class="fn" id="testOption"><a name="testOption"></a><span class="type">bool</span> QPrintDialog::<span class="name">testOption</span>(<span class="type"><a href="qabstractprintdialog.html#PrintDialogOption-enum">PrintDialogOption</a></span> <i>option</i>) const</h3>
<p>Returns <code>true</code> if the given <i>option</i> is enabled; otherwise, returns false.</p>
<p><b>See also </b><a href="qprintdialog.html#options-prop">options</a> and <a href="qprintdialog.html#setOption">setOption</a>().</p>
<!-- @@@testOption -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>