<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html><head><title>QPrintEngine Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } td.postheader { font-family: sans-serif } tr.address { font-family: sans-serif } body { background: #ffffff; color: black; } </style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" 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="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QPrintEngine Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QPrintEngine class defines an interface for how <a href="qprinter.html">QPrinter</a> interacts with a given printing subsystem. <a href="#details">More...</a></p> <h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qprintengine.html#PrintEnginePropertyKey-enum">PrintEnginePropertyKey</a></b> { PPK_CollateCopies, PPK_ColorMode, PPK_Creator, PPK_DocumentName, ..., PPK_CustomBase }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qprintengine.html#QPrintEngine">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qprintengine.html#QPrintEngine-2">__init__</a></b> (<i>self</i>, QPrintEngine)</li><li><div class="fn" />bool <b><a href="qprintengine.html#abort">abort</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qprintengine.html#metric">metric</a></b> (<i>self</i>, QPaintDevice.PaintDeviceMetric)</li><li><div class="fn" />bool <b><a href="qprintengine.html#newPage">newPage</a></b> (<i>self</i>)</li><li><div class="fn" />QPrinter.PrinterState <b><a href="qprintengine.html#printerState">printerState</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qprintengine.html#property">property</a></b> (<i>self</i>, PrintEnginePropertyKey <i>key</i>)</li><li><div class="fn" /><b><a href="qprintengine.html#setProperty">setProperty</a></b> (<i>self</i>, PrintEnginePropertyKey <i>key</i>, QVariant <i>value</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QPrintEngine class defines an interface for how <a href="qprinter.html">QPrinter</a> interacts with a given printing subsystem.</p> <p>The common case when creating your own print engine is to derive from both <a href="qpaintengine.html">QPaintEngine</a> and QPrintEngine. Various properties of a print engine are given with <a href="qprintengine.html#property">property</a>() and set with <a href="qprintengine.html#setProperty">setProperty</a>().</p> <hr /><h2>Type Documentation</h2><h3 class="fn"><a name="PrintEnginePropertyKey-enum" />QPrintEngine.PrintEnginePropertyKey</h3><p>This enum is used to communicate properties between the print engine and <a href="qprinter.html">QPrinter</a>. A property may or may not be supported by a given print engine.</p> <table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_CollateCopies</tt></td> <td class="topAlign"><tt>0</tt></td> <td class="topAlign">A boolean value indicating whether the printout should be collated or not.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_ColorMode</tt></td> <td class="topAlign"><tt>1</tt></td> <td class="topAlign">Refers to <a href="qprinter.html#ColorMode-enum">QPrinter.ColorMode</a>, either color or monochrome.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_Creator</tt></td> <td class="topAlign"><tt>2</tt></td> <td class="topAlign">A string describing the document's creator.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_Duplex</tt></td> <td class="topAlign"><tt>21</tt></td> <td class="topAlign">A boolean value indicating whether both sides of the printer paper should be used for the printout.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_DocumentName</tt></td> <td class="topAlign"><tt>3</tt></td> <td class="topAlign">A string describing the document name in the spooler.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_FontEmbedding</tt></td> <td class="topAlign"><tt>19</tt></td> <td class="topAlign">A boolean value indicating whether data for the document's fonts should be embedded in the data sent to the printer.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_FullPage</tt></td> <td class="topAlign"><tt>4</tt></td> <td class="topAlign">A boolean describing if the printer should be full page or not.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_NumberOfCopies</tt></td> <td class="topAlign"><tt>5</tt></td> <td class="topAlign">Obsolete. An integer specifying the number of copies. Use PPK_CopyCount instead.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_Orientation</tt></td> <td class="topAlign"><tt>6</tt></td> <td class="topAlign">Specifies a <a href="qprinter.html#Orientation-enum">QPrinter.Orientation</a> value.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_OutputFileName</tt></td> <td class="topAlign"><tt>7</tt></td> <td class="topAlign">The output file name as a string. An empty file name indicates that the printer should not print to a file.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_PageOrder</tt></td> <td class="topAlign"><tt>8</tt></td> <td class="topAlign">Specifies a <a href="qprinter.html#PageOrder-enum">QPrinter.PageOrder</a> value.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_PageRect</tt></td> <td class="topAlign"><tt>9</tt></td> <td class="topAlign">A <a href="qrect.html">QRect</a> specifying the page rectangle</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_PageSize</tt></td> <td class="topAlign"><tt>10</tt></td> <td class="topAlign">Obsolete. Use PPK_PaperSize instead.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_PaperRect</tt></td> <td class="topAlign"><tt>11</tt></td> <td class="topAlign">A <a href="qrect.html">QRect</a> specifying the paper rectangle.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_PaperSource</tt></td> <td class="topAlign"><tt>12</tt></td> <td class="topAlign">Specifies a <a href="qprinter.html#PaperSource-enum">QPrinter.PaperSource</a> value.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_PaperSources</tt></td> <td class="topAlign"><tt>22</tt></td> <td class="topAlign">Specifies more than one <a href="qprinter.html#PaperSource-enum">QPrinter.PaperSource</a> value.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_PaperSize</tt></td> <td class="topAlign"><tt>PPK_PageSize</tt></td> <td class="topAlign">Specifies a <a href="qprinter.html#PaperSize-enum">QPrinter.PaperSize</a> value.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_PrinterName</tt></td> <td class="topAlign"><tt>13</tt></td> <td class="topAlign">A string specifying the name of the printer.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_PrinterProgram</tt></td> <td class="topAlign"><tt>14</tt></td> <td class="topAlign">A string specifying the name of the printer program used for printing,</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_Resolution</tt></td> <td class="topAlign"><tt>15</tt></td> <td class="topAlign">An integer describing the dots per inch for this printer.</td> </tr> <tr> <td class="topAlign"> <tt>QPrintEngine.PPK_SelectionOption</tt></td> <td class="topAlign"><tt>16</tt></td> <td class="topAlign"> </td> </tr> <tr> <td class="topAlign"> <tt>QPrintEngine.PPK_SupportedResolutions</tt></td> <td class="topAlign"><tt>17</tt></td> <td class="topAlign">A list of integer <a href="qtwebkit-bridge.html#qvariants">QVariants</a> describing the set of supported resolutions that the printer has.</td> </tr> <tr> <td class="topAlign"> <tt>QPrintEngine.PPK_SuppressSystemPrintStatus</tt></td> <td class="topAlign"><tt>20</tt></td> <td class="topAlign">Suppress the built-in dialog for showing printing progress. As of 4.1 this only has effect on Mac OS X where, by default, a status dialog is shown.</td> </tr> <tr> <td class="topAlign"> <tt>QPrintEngine.PPK_WindowsPageSize</tt></td> <td class="topAlign"><tt>18</tt></td> <td class="topAlign">An integer specifying a DM_PAPER entry on Windows.</td> </tr> <tr> <td class="topAlign"> <tt>QPrintEngine.PPK_CustomPaperSize</tt></td> <td class="topAlign"><tt>23</tt></td> <td class="topAlign">A <a href="qsizef.html">QSizeF</a> specifying a custom paper size in the <a href="qprinter.html#Unit-enum">QPrinter.Point</a> unit.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_PageMargins</tt></td> <td class="topAlign"><tt>24</tt></td> <td class="topAlign">A <a href="qlist.html">QList</a><<a href="qvariant.html">QVariant</a>> containing the left, top, right and bottom margin values.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_CopyCount</tt></td> <td class="topAlign"><tt>25</tt></td> <td class="topAlign">An integer specifying the number of copies to print.</td> </tr> <tr> <td class="topAlign"> <tt>QPrintEngine.PPK_SupportsMultipleCopies</tt></td> <td class="topAlign"><tt>26</tt></td> <td class="topAlign">A boolean value indicating whether or not the printer supports printing multiple copies in one job.</td> </tr> <tr> <td class="topAlign"><tt>QPrintEngine.PPK_CustomBase</tt></td> <td class="topAlign"><tt>0xff00</tt></td> <td class="topAlign">Basis for extension.</td> </tr> </table> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QPrintEngine" />QPrintEngine.__init__ (<i>self</i>)</h3><h3 class="fn"><a name="QPrintEngine-2" />QPrintEngine.__init__ (<i>self</i>, <a href="qprintengine.html">QPrintEngine</a>)</h3><h3 class="fn"><a name="abort" />bool QPrintEngine.abort (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Instructs the print engine to abort the printing process. Returns true if successful; otherwise returns false.</p> <h3 class="fn"><a name="metric" />int QPrintEngine.metric (<i>self</i>, <a href="qpaintdevice.html#PaintDeviceMetric-enum">QPaintDevice.PaintDeviceMetric</a>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the metric for the given <i>id</i>.</p> <h3 class="fn"><a name="newPage" />bool QPrintEngine.newPage (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Instructs the print engine to start a new page. Returns true if the printer was able to create the new page; otherwise returns false.</p> <h3 class="fn"><a name="printerState" /><a href="qprinter.html#PrinterState-enum">QPrinter.PrinterState</a> QPrintEngine.printerState (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the current state of the printer being used by the print engine.</p> <h3 class="fn"><a name="property" />QVariant QPrintEngine.property (<i>self</i>, <a href="qprintengine.html#PrintEnginePropertyKey-enum">PrintEnginePropertyKey</a> <i>key</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the print engine's property specified by <i>key</i>.</p> <p><b>See also</b> <a href="qprintengine.html#setProperty">setProperty</a>().</p> <h3 class="fn"><a name="setProperty" />QPrintEngine.setProperty (<i>self</i>, <a href="qprintengine.html#PrintEnginePropertyKey-enum">PrintEnginePropertyKey</a> <i>key</i>, QVariant <i>value</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the print engine's property specified by <i>key</i> to the given <i>value</i>.</p> <p><b>See also</b> <a href="qprintengine.html#property">property</a>().</p> <address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>