Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1647

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/kernel/qprinter.cpp:42 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QPrinter Class</title>
<style type="text/css"><!--
h3.fn,span.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&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;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>QPrinter Class Reference</h1>

<p>The QPrinter class is a paint device that paints on a printer.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qprinter-h.html">qprinter.h</a>&gt;</tt>
<p>Inherits <a href="qpaintdevice.html">QPaintDevice</a>.
<p><a href="qprinter-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn>enum <a href="#PrinterMode-enum"><b>PrinterMode</b></a> { ScreenResolution, PrinterResolution, HighResolution, Compatible }</div></li>
<li><div class=fn><a href="#QPrinter"><b>QPrinter</b></a> ( PrinterMode&nbsp;m = ScreenResolution )</div></li>
<li><div class=fn><a href="#~QPrinter"><b>~QPrinter</b></a> ()</div></li>
<li><div class=fn>enum <a href="#Orientation-enum"><b>Orientation</b></a> { Portrait, Landscape }</div></li>
<li><div class=fn>enum <a href="#PageSize-enum"><b>PageSize</b></a> { A4, B5, Letter, Legal, Executive, A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1, B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E, DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom }</div></li>
<li><div class=fn>enum <a href="#PageOrder-enum"><b>PageOrder</b></a> { FirstPageFirst, LastPageFirst }</div></li>
<li><div class=fn>enum <a href="#ColorMode-enum"><b>ColorMode</b></a> { GrayScale, Color }</div></li>
<li><div class=fn>enum <a href="#PaperSource-enum"><b>PaperSource</b></a> { OnlyOne, Lower, Middle, Manual, Envelope, EnvelopeManual, Auto, Tractor, SmallFormat, LargeFormat, LargeCapacity, Cassette, FormSource }</div></li>
<li><div class=fn>QString <a href="#printerName"><b>printerName</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setPrinterName"><b>setPrinterName</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name )</div></li>
<li><div class=fn>bool <a href="#outputToFile"><b>outputToFile</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setOutputToFile"><b>setOutputToFile</b></a> ( bool&nbsp;enable )</div></li>
<li><div class=fn>QString <a href="#outputFileName"><b>outputFileName</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setOutputFileName"><b>setOutputFileName</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;fileName )</div></li>
<li><div class=fn>QString <a href="#printProgram"><b>printProgram</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setPrintProgram"><b>setPrintProgram</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;printProg )</div></li>
<li><div class=fn>QString <a href="#printerSelectionOption"><b>printerSelectionOption</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setPrinterSelectionOption"><b>setPrinterSelectionOption</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;option )</div></li>
<li><div class=fn>QString <a href="#docName"><b>docName</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setDocName"><b>setDocName</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name )</div></li>
<li><div class=fn>QString <a href="#creator"><b>creator</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setCreator"><b>setCreator</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;creator )</div></li>
<li><div class=fn>Orientation <a href="#orientation"><b>orientation</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setOrientation"><b>setOrientation</b></a> ( Orientation&nbsp;orientation )</div></li>
<li><div class=fn>PageSize <a href="#pageSize"><b>pageSize</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setPageSize"><b>setPageSize</b></a> ( PageSize&nbsp;newPageSize )</div></li>
<li><div class=fn>short <a href="#winPageSize"><b>winPageSize</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setPageOrder"><b>setPageOrder</b></a> ( PageOrder&nbsp;newPageOrder )</div></li>
<li><div class=fn>PageOrder <a href="#pageOrder"><b>pageOrder</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setResolution"><b>setResolution</b></a> ( int&nbsp;dpi )</div></li>
<li><div class=fn>virtual int <a href="#resolution"><b>resolution</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setColorMode"><b>setColorMode</b></a> ( ColorMode&nbsp;newColorMode )</div></li>
<li><div class=fn>ColorMode <a href="#colorMode"><b>colorMode</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setFullPage"><b>setFullPage</b></a> ( bool&nbsp;fp )</div></li>
<li><div class=fn>bool <a href="#fullPage"><b>fullPage</b></a> () const</div></li>
<li><div class=fn>QSize <a href="#margins"><b>margins</b></a> () const</div></li>
<li><div class=fn>int <a href="#fromPage"><b>fromPage</b></a> () const</div></li>
<li><div class=fn>int <a href="#toPage"><b>toPage</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setFromTo"><b>setFromTo</b></a> ( int&nbsp;fromPage, int&nbsp;toPage )</div></li>
<li><div class=fn>int <a href="#minPage"><b>minPage</b></a> () const</div></li>
<li><div class=fn>int <a href="#maxPage"><b>maxPage</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setMinMax"><b>setMinMax</b></a> ( int&nbsp;minPage, int&nbsp;maxPage )</div></li>
<li><div class=fn>int <a href="#numCopies"><b>numCopies</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setNumCopies"><b>setNumCopies</b></a> ( int&nbsp;numCopies )</div></li>
<li><div class=fn>bool <a href="#newPage"><b>newPage</b></a> ()</div></li>
<li><div class=fn>bool <a href="#abort"><b>abort</b></a> ()</div></li>
<li><div class=fn>bool <a href="#aborted"><b>aborted</b></a> () const</div></li>
<li><div class=fn>bool <a href="#setup"><b>setup</b></a> ( QWidget&nbsp;*&nbsp;parent = 0 )</div></li>
<li><div class=fn>PaperSource <a href="#paperSource"><b>paperSource</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setPaperSource"><b>setPaperSource</b></a> ( PaperSource&nbsp;source )</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The QPrinter class is a paint device that paints on a printer.
<p> 


<p> On Windows it uses the built-in printer drivers.  On X11 it
generates postscript and sends that to lpr, lp, or another print
command.
<p> QPrinter is used much the same way as <a href="qwidget.html">QWidget</a> and <a href="qpixmap.html">QPixmap</a> are
used.  The big difference is that you must keep track of the pages.
<p> QPrinter supports a number of settable parameters, most of which can be
changed by the end user when the application calls <a href="#setup">QPrinter::setup</a>().
<p> The most important parameters are:
<ul>
<li> <a href="#setOrientation">setOrientation</a>() tells QPrinter which page orientation to use (virtual).
<li> <a href="#setPageSize">setPageSize</a>() tells QPrinter what page size to expect from the
printer.
<li> <a href="#setResolution">setResolution</a>() tells QPrinter what resolution you wish the
printer to provide (in dpi).
<li> <a href="#setFullPage">setFullPage</a>() tells QPrinter whether you want to deal with the
full page (so you can have accurate margins, etc.) or just with
the part the printer can draw on.  The default is FALSE, so that by
default you can probably paint on (0,0) but the document's margins
are unknown.
<p> <li> <a href="#setNumCopies">setNumCopies</a>() tells QPrinter how many copies of the document
it should print.
<li> <a href="#setMinMax">setMinMax</a>() tells QPrinter and QPrintDialog what the allowed
range for <a href="#fromPage">fromPage</a>() and <a href="#toPage">toPage</a>() are.
</ul>
<p> Except where noted, you can only call the set functions before
<a href="#setup">setup</a>(), or between <a href="qpainter.html#end">QPainter::end</a>() and setup(). (Some may take
effect between setup() and begin(), or between begin() and end(),
but that's strictly undocumented and such behaviour may differ
depending on platform.)
<p> There are also some settings that the user sets (through the printer
dialog) and that applications are expected to obey:
<p> <ul>
<p> <li> <a href="#pageOrder">pageOrder</a>() tells the application program whether to print
first-page-first or last-page-first.
<p> <li> <a href="#colorMode">colorMode</a>() tells the application program whether to print
in color or grayscale.  (If you print in color and the printer does
not support color, Qt will try to approximate.  The document may
take longer to print, but the quality should not be made visibly
poorer.)
<p> <li> fromPage() and toPage() indicate what pages the application
program should print.
<p> <li> <a href="#paperSource">paperSource</a>() tells the application progam which paper source
to print from.
<p> </ul>
<p> You can of course call these functions to establish defaults
before you ask the user through <a href="#setup">QPrinter::setup</a>().
<p> Once you start printing, <a href="#newPage">newPage</a>() is essential.  You will
probably also need to look at the <a href="qpaintdevicemetrics.html">QPaintDeviceMetrics</a> for the
printer (see the <a href="simple-application.html#printersimple">print
  function</a> in the Application walk-through). Note that the
paint device metrics are valid only after the QPrinter has been set
up, i.e. after <a href="#setup">setup</a>() has returned successfully. If you want
high-quality printing with accurate margins, it is essential to call
<a href="#setFullPage">setFullPage</a>(TRUE).
<p> If you want to abort the print job, <a href="#abort">abort</a>() will try its best to
stop printing. It may cancel the entire job or just some of it.
<p> 
<p> The true type font embedding for Qt's post script driver uses code
by David Chappell of Trinity College Computing Center.
<p> 
<p> Copyright 1995, Trinity College Computing Center.
Written by David Chappell.
<p> Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, provided
that the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.  This software is provided "as is" without express or
implied warranty.
<p> TrueType font support.  These functions allow PPR to generate
PostScript fonts from Microsoft compatible TrueType font files.
<p> The functions in this file do most of the work to convert a
TrueType font to a type 3 PostScript font.
<p> Most of the material in this file is derived from a program called
"ttf2ps" which L. S. Ng posted to the usenet news group
"comp.sources.postscript".  The author did not provide a copyright
notice or indicate any restrictions on use.
<p> Last revised 11 July 1995.
<p> <p>See also <a href="graphics.html">Graphics Classes</a> and <a href="images.html">Image Processing Classes</a>.

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="ColorMode-enum"></a>QPrinter::ColorMode</h3> 
<p> This enum type is used to indicate whether QPrinter should print in
color or not.  The possible values are:
<ul>
<li><tt>QPrinter::Color</tt> - print in color if available, otherwise in grayscale.  This
is the default.
<li><tt>QPrinter::GrayScale</tt> - print in grayscale, even on color printers.
Might be a little faster than <a href="#ColorMode-enum">Color</a>.
</ul>
<h3 class=fn><a name="Orientation-enum"></a>QPrinter::Orientation</h3> 
<p> This enum type (not to be confused with Qt::Orientation) is used to
specify each page's orientation.
<ul>
<li><tt>QPrinter::Portrait</tt> - the page's height is greater than its width (the
default).
<li><tt>QPrinter::Landscape</tt> - the page's width is greater than its height.
</ul><p> This type interacts with QPrinter::PageSize and
<a href="#setFullPage">QPrinter::setFullPage</a>() to determine the final size of the page
available to the application.

<h3 class=fn><a name="PageOrder-enum"></a>QPrinter::PageOrder</h3> 
<p> This enum type is used by QPrinter to tell the
application program how to print.  The possible values are
<ul>
<li><tt>QPrinter::FirstPageFirst</tt> - the lowest-numbered page should
be printed first.
<li><tt>QPrinter::LastPageFirst</tt> - the highest-numbered page should
be printed first.
</ul>
<h3 class=fn><a name="PageSize-enum"></a>QPrinter::PageSize</h3> 
<p> This enum type specifies what paper size QPrinter should use.  QPrinter
does not check that the paper size is available; it just uses this
information, together with QPrinter::Orientation and
<a href="#setFullPage">QPrinter::setFullPage</a>(), to determine the printable area (see
<a href="qpaintdevicemetrics.html">QPaintDeviceMetrics</a>).
<p> The defined sizes (with <a href="#setFullPage">setFullPage</a>(TRUE)) are:
<ul>
<li><tt>QPrinter::A0</tt> - 841 x 1189 mm
<li><tt>QPrinter::A1</tt> - 594 x 841 mm
<li><tt>QPrinter::A2</tt> - 420 x 594 mm
<li><tt>QPrinter::A3</tt> - 297 x 420 mm
<li><tt>QPrinter::A4</tt> - 210 x 297 mm, 8.26 x 11.7 inches
<li><tt>QPrinter::A5</tt> - 148 x 210 mm
<li><tt>QPrinter::A6</tt> - 105 x 148 mm
<li><tt>QPrinter::A7</tt> - 74 x 105 mm
<li><tt>QPrinter::A8</tt> - 52 x 74 mm
<li><tt>QPrinter::A9</tt> - 37 x 52 mm
<li><tt>QPrinter::B0</tt> - 1030 x 1456 mm
<li><tt>QPrinter::B1</tt> - 728 x 1030 mm
<li><tt>QPrinter::B10</tt> - 32 x 45 mm
<li><tt>QPrinter::B2</tt> - 515 x 728 mm
<li><tt>QPrinter::B3</tt> - 364 x 515 mm
<li><tt>QPrinter::B4</tt> - 257 x 364 mm
<li><tt>QPrinter::B5</tt> - 182 x 257 mm, 7.17 x 10.13 inches
<li><tt>QPrinter::B6</tt> - 128 x 182 mm
<li><tt>QPrinter::B7</tt> - 91 x 128 mm
<li><tt>QPrinter::B8</tt> - 64 x 91 mm
<li><tt>QPrinter::B9</tt> - 45 x 64 mm
<li><tt>QPrinter::C5E</tt> - 163 x 229 mm
<li><tt>QPrinter::Comm10E</tt> - 105 x 241 mm, US Common #10 Envelope
<li><tt>QPrinter::DLE</tt> - 110 x 220 mm
<li><tt>QPrinter::Executive</tt> - 7.5 x 10 inches, 191 x 254 mm
<li><tt>QPrinter::Folio</tt> - 210 x 330 mm
<li><tt>QPrinter::Ledger</tt> - 432 x 279 mm
<li><tt>QPrinter::Legal</tt> - 8.5 x 14 inches, 216 x 356 mm
<li><tt>QPrinter::Letter</tt> - 8.5 x 11 inches, 216 x 279 mm
<li><tt>QPrinter::Tabloid</tt> - 279 x 432 mm
<li><tt>QPrinter::Custom</tt>
<li><tt>QPrinter::NPageSize</tt> - (internal)
</ul><p> With <a href="#setFullPage">setFullPage</a>(FALSE) (the default), the metrics will be a bit
smaller; how much depends on the printer in use.

<h3 class=fn><a name="PaperSource-enum"></a>QPrinter::PaperSource</h3> 
<p> This enum type specifies what paper source QPrinter is to use.  QPrinter
does not check that the paper source is available; it just uses this
information to try and set the paper source.  Whether it will set the
paper source depends on whether the printer has that particular source.
<p> Note: this is currently only implemented for Windows.
<ul>
<li><tt>QPrinter::OnlyOne</tt>
<li><tt>QPrinter::Lower</tt>
<li><tt>QPrinter::Middle</tt>
<li><tt>QPrinter::Manual</tt>
<li><tt>QPrinter::Envelope</tt>
<li><tt>QPrinter::EnvelopeManual</tt>
<li><tt>QPrinter::Auto</tt>
<li><tt>QPrinter::Tractor</tt>
<li><tt>QPrinter::SmallFormat</tt>
<li><tt>QPrinter::LargeFormat</tt>
<li><tt>QPrinter::LargeCapacity</tt>
<li><tt>QPrinter::Cassette</tt>
<li><tt>QPrinter::FormSource</tt>
</ul>
<h3 class=fn><a name="PrinterMode-enum"></a>QPrinter::PrinterMode</h3> 
<p> This enum describes the mode the printer should work in. It basically
presets a certain resolution and working mode.
<ul>
<li><tt>QPrinter::ScreenResolution</tt> - Sets the resolution of the print device to the
screen resolution. This has the big advantage that the results obtained
when painting on the printer will match more or less exactly the visible
output on the screen. It is the easiest to use, as font metrics on the
screen and on the printer are the same. This is the default value.
<li><tt>QPrinter::PrinterResolution</tt> - Use the physical resolution of the printer on
Windows. On Unix, set the postscript resolution to 72 dpi.
<li><tt>QPrinter::HighResolution</tt> - Use printer resolution on windows, set the resolution
of the postscript driver to 600dpi.
<li><tt>QPrinter::Compatible</tt> - Almost the same as PrinterResolution, but keeps some
peculiarities of the printer dirver of Qt 2.x. This is useful, when porting an
application from Qt 2.x to Qt 3.x.
</ul><p> 
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QPrinter"></a>QPrinter::QPrinter ( <a href="qprinter.html#PrinterMode-enum">PrinterMode</a>&nbsp;m = ScreenResolution )
</h3>
Constructs a printer paint device with mode <em>m</em>.
<p> <p>See also <a href="#PrinterMode-enum">QPrinter::PrinterMode</a>.

<h3 class=fn><a name="~QPrinter"></a>QPrinter::~QPrinter ()
</h3>
Destroys the printer paint device and cleans up.

<h3 class=fn>bool <a name="abort"></a>QPrinter::abort ()
</h3>
Aborts the print job.
Returns TRUE if successful, otherwise FALSE.
<p>See also <a href="#aborted">aborted</a>().

<h3 class=fn>bool <a name="aborted"></a>QPrinter::aborted () const
</h3>
Returns TRUE is the printer job was aborted, otherwise FALSE.
<p>See also <a href="#abort">abort</a>().

<h3 class=fn><a href="qprinter.html#ColorMode-enum">ColorMode</a> <a name="colorMode"></a>QPrinter::colorMode () const
</h3>  Returns the current color mode.  The default color mode is <a href="#ColorMode-enum">Color</a>.
<p> <p>See also <a href="#setColorMode">setColorMode</a>().

<h3 class=fn><a href="qstring.html">QString</a> <a name="creator"></a>QPrinter::creator () const
</h3>

<p> Returns the name of the application that created the document.
<p>See also <a href="#setCreator">setCreator</a>().

<h3 class=fn><a href="qstring.html">QString</a> <a name="docName"></a>QPrinter::docName () const
</h3>

<p> Returns the document name.
<p>See also <a href="#setDocName">setDocName</a>().

<h3 class=fn>int <a name="fromPage"></a>QPrinter::fromPage () const
</h3>

<p> Returns the from-page setting.  The default value is 0.
<p> If <a href="#fromPage">fromPage</a>() and <a href="#toPage">toPage</a>() both return 0 this should signify 'print
the whole document'.
<p> The programmer is responsible for reading this setting and printing
accordingly.
<p> <p>See also <a href="#setFromTo">setFromTo</a>() and <a href="#toPage">toPage</a>().

<h3 class=fn>bool <a name="fullPage"></a>QPrinter::fullPage () const
</h3>  Returns TRUE if the origin of the printer's coordinate system is
at the corner of the sheet and FALSE if it is at the edge of the
printable area.
<p> See <a href="#setFullPage">setFullPage</a>() for details and caveats.
<p> <p>See also <a href="#setFullPage">setFullPage</a>(), <a href="#PageSize-enum">PageSize</a> and <a href="qpaintdevicemetrics.html">QPaintDeviceMetrics</a>.

<h3 class=fn><a href="qsize.html">QSize</a> <a name="margins"></a>QPrinter::margins () const
</h3>  Returns the width of the left/right and top/bottom margins of the
printer.  This is a best-effort guess, not based on perfect knowledge.
<p> If you have called <a href="#setFullPage">setFullPage</a>( TRUE ) (this is recommended for
high-quality printing), <a href="#margins">margins</a>().width() may be treated as the
smallest sane left/right margin you can use, and margins().height() as
the smallest sane top/bottom margins you can use.
<p> If you have called setFullPage( FALSE ) (this is the default),
margins() is automatically subtracted from the <a href="#pageSize">pageSize</a>() by QPrinter.
<p> <p>See also <a href="#setFullPage">setFullPage</a>(), <a href="qpaintdevicemetrics.html">QPaintDeviceMetrics</a> and <a href="#PageSize-enum">PageSize</a>.

<h3 class=fn>int <a name="maxPage"></a>QPrinter::maxPage () const
</h3>

<p> Returns the max-page setting. A user can't choose a higher page number
than <a href="#maxPage">maxPage</a>() when they select a print range. The default value is 0.
<p>See also <a href="#minPage">minPage</a>(), <a href="#setMinMax">setMinMax</a>() and <a href="#setFromTo">setFromTo</a>().

<h3 class=fn>int <a name="minPage"></a>QPrinter::minPage () const
</h3>

<p> Returns the min-page setting, i.e. the lowest page number a user
is allowed to choose.  The default value is 0.
<p>See also <a href="#maxPage">maxPage</a>(), <a href="#setMinMax">setMinMax</a>() and <a href="#setFromTo">setFromTo</a>().

<h3 class=fn>bool <a name="newPage"></a>QPrinter::newPage ()
</h3>
Advances to a new page on the printer.
Returns TRUE if successful, otherwise FALSE.

<p>Examples: <a href="qaction-application-example.html#x2036">action/application.cpp</a>, <a href="simple-application-example.html#x1934">application/application.cpp</a>, <a href="helpviewer-example.html#x1412">helpviewer/helpwindow.cpp</a> and <a href="mdi-example.html#x1168">mdi/application.cpp</a>.
<h3 class=fn>int <a name="numCopies"></a>QPrinter::numCopies () const
</h3>

<p> Returns the number of copies to be printed.  The default value is 1.
<p>See also <a href="#setNumCopies">setNumCopies</a>().

<h3 class=fn><a href="qprinter.html#Orientation-enum">Orientation</a> <a name="orientation"></a>QPrinter::orientation () const
</h3>

<p> Returns the orientation setting.  The default value is <a href="#Orientation-enum">QPrinter::Portrait</a>.
<p>See also <a href="#setOrientation">setOrientation</a>().

<h3 class=fn><a href="qstring.html">QString</a> <a name="outputFileName"></a>QPrinter::outputFileName () const
</h3>

Returns the name of the output file.  There is no default file name.
<p>See also <a href="#setOutputFileName">setOutputFileName</a>() and <a href="#setOutputToFile">setOutputToFile</a>().

<h3 class=fn>bool <a name="outputToFile"></a>QPrinter::outputToFile () const
</h3>

<p> Returns TRUE if the output should be written to a file, or FALSE if the
output should be sent directly to the printer.
The default setting is FALSE.
<p> This function is currently only supported under X11.
<p> <p>See also <a href="#setOutputToFile">setOutputToFile</a>() and <a href="#setOutputFileName">setOutputFileName</a>().

<h3 class=fn><a href="qprinter.html#PageOrder-enum">PageOrder</a> <a name="pageOrder"></a>QPrinter::pageOrder () const
</h3>  Returns the current page order.
<p> The default page order is FirstPageFirst.

<h3 class=fn><a href="qprinter.html#PageSize-enum">PageSize</a> <a name="pageSize"></a>QPrinter::pageSize () const
</h3>

<p> Returns the printer page size.  The default value is system-dependent.
<p> <p>See also <a href="#setPageSize">setPageSize</a>().

<h3 class=fn><a href="qprinter.html#PaperSource-enum">PaperSource</a> <a name="paperSource"></a>QPrinter::paperSource () const
</h3> Returns the currently set paper source of the printer.
<p> <p>See also <a href="#setPaperSource">setPaperSource</a>().

<h3 class=fn><a href="qstring.html">QString</a> <a name="printProgram"></a>QPrinter::printProgram () const
</h3>

<p> Returns the name of the program that sends the print output to the printer.
<p> The default is to return a null string; meaning that QPrinter will
try to be smart in a system-dependent way.  On X11 only, you can set
it to something different to use a specific print program.
<p> On Windows, this function returns the name of the printer device driver.
<p> <p>See also <a href="#setPrintProgram">setPrintProgram</a>() and <a href="#setPrinterSelectionOption">setPrinterSelectionOption</a>().

<h3 class=fn><a href="qstring.html">QString</a> <a name="printerName"></a>QPrinter::printerName () const
</h3>

<p> Returns the printer name.  This value is initially set to the name of the
default printer.
<p> <p>See also <a href="#setPrinterName">setPrinterName</a>().

<h3 class=fn><a href="qstring.html">QString</a> <a name="printerSelectionOption"></a>QPrinter::printerSelectionOption () const
</h3>  Returns the printer options selection string.  This is
useful only if the print command has been explicitly set.
<p> The default value (a null string) implies that the printer should be
selected in a system-dependent manner.
<p> Any other value implies that the given value should be used.
<p> <p>See also <a href="#setPrinterSelectionOption">setPrinterSelectionOption</a>().

<h3 class=fn>int <a name="resolution"></a>QPrinter::resolution () const<tt> [virtual]</tt>
</h3> Returns the current assumed resolution of the printer, as set by
<a href="#setResolution">setResolution</a>() or by the printer subsystem.
<p> <p>See also <a href="#setResolution">setResolution</a>().

<h3 class=fn>void <a name="setColorMode"></a>QPrinter::setColorMode ( <a href="qprinter.html#ColorMode-enum">ColorMode</a>&nbsp;newColorMode )<tt> [virtual]</tt>
</h3>  Sets the printer's color mode to <em>newColorMode</em>, which can be
one of <a href="#ColorMode-enum">Color</a> (the default) or <a href="#ColorMode-enum">GrayScale</a>.
<p> <p>See also <a href="#colorMode">colorMode</a>().

<h3 class=fn>void <a name="setCreator"></a>QPrinter::setCreator ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;creator )<tt> [virtual]</tt>
</h3>
Sets the name of the application that created the document to <em>creator</em>.
<p> This function is only applicable to the X11 version of Qt. If no
creator name is specified, the creator will be set to "Qt"
followed by some version number.
<p> <p>See also <a href="#creator">creator</a>().

<h3 class=fn>void <a name="setDocName"></a>QPrinter::setDocName ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name )<tt> [virtual]</tt>
</h3>
Sets the document name to <em>name</em>.

<h3 class=fn>void <a name="setFromTo"></a>QPrinter::setFromTo ( int&nbsp;fromPage, int&nbsp;toPage )<tt> [virtual]</tt>
</h3>
Sets the from-page and to-page settings to <em>fromPage</em> and <em>toPage</em>
respectively.
<p> The from-page and to-page settings specify what pages to print.
<p> If <em>fromPage</em> and <em>toPage</em> are both 0 this should signify 'print
the whole document'.
<p> This function is useful mostly to set a default value that the
user can override in the print dialog when you call <a href="#setup">setup</a>().
<p> <p>See also <a href="#fromPage">fromPage</a>(), <a href="#toPage">toPage</a>(), <a href="#setMinMax">setMinMax</a>() and <a href="#setup">setup</a>().

<h3 class=fn>void <a name="setFullPage"></a>QPrinter::setFullPage ( bool&nbsp;fp )<tt> [virtual]</tt>
</h3>  Sets QPrinter to have the origin of the coordinate system at the
top-left corner of the paper if <em>fp</em> is TRUE, or where it thinks the
top-left corner of the printable area is if <em>fp</em> is FALSE.
<p> The default is FALSE. You can (probably) print on (0,0), and
<a href="qpaintdevicemetrics.html">QPaintDeviceMetrics</a> will report something smaller than the size
indicated by PageSize.  (Note that QPrinter may be wrong - it does not
have perfect knowledge of the physical printer.)
<p> If you set <em>fp</em> to TRUE, QPaintDeviceMetrics will report the exact
same size as indicated by PageSize, but you cannot print on all of
that - you have to take care of the output margins yourself.
<p> <p>See also <a href="#PageSize-enum">PageSize</a>, <a href="#setPageSize">setPageSize</a>(), <a href="qpaintdevicemetrics.html">QPaintDeviceMetrics</a> and <a href="#fullPage">fullPage</a>().

<p>Example: <a href="helpviewer-example.html#x1413">helpviewer/helpwindow.cpp</a>.
<h3 class=fn>void <a name="setMinMax"></a>QPrinter::setMinMax ( int&nbsp;minPage, int&nbsp;maxPage )<tt> [virtual]</tt>
</h3>
Sets the min-page and max-page settings to <em>minPage</em> and <em>maxPage</em>
respectively.
<p> The min-page and max-page restrict the from-page and to-page
settings.  When the printer setup dialog appears, the user cannot
select a from page or a to page that are outside the range specified
by min and max pages.
<p> <p>See also <a href="#minPage">minPage</a>(), <a href="#maxPage">maxPage</a>(), <a href="#setFromTo">setFromTo</a>() and <a href="#setup">setup</a>().

<h3 class=fn>void <a name="setNumCopies"></a>QPrinter::setNumCopies ( int&nbsp;numCopies )<tt> [virtual]</tt>
</h3>
Sets the number of pages to be printed to <em>numCopies</em>.
<p> The printer driver reads this setting and prints the specified number of
copies.
<p> <p>See also <a href="#numCopies">numCopies</a>() and <a href="#setup">setup</a>().

<h3 class=fn>void <a name="setOrientation"></a>QPrinter::setOrientation ( <a href="qprinter.html#Orientation-enum">Orientation</a>&nbsp;orientation )<tt> [virtual]</tt>
</h3>
Sets the print orientation to <em>orientation</em>.
<p> The orientation can be either <a href="#Orientation-enum">QPrinter::Portrait</a> or
<a href="#Orientation-enum">QPrinter::Landscape</a>.
<p> The printer driver reads this setting and prints using the specified
orientation.  On Windows however, this setting won't take effect until
the printer dialog is shown (using <a href="#setup">QPrinter::setup</a>()).
<p> <p>See also <a href="#orientation">orientation</a>().

<h3 class=fn>void <a name="setOutputFileName"></a>QPrinter::setOutputFileName ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;fileName )<tt> [virtual]</tt>
</h3>
Sets the name of the output file to <em>fileName</em>.
<p> Setting a null or empty name (0 or "") disables output to a file,
i.e. calls <a href="#setOutputToFile">setOutputToFile</a>(FALSE). Setting a non-empty name enables
output to a file, i.e. calls setOutputToFile(TRUE).
<p> This function is currently only supported under X11.
<p> <p>See also <a href="#outputFileName">outputFileName</a>() and <a href="#setOutputToFile">setOutputToFile</a>().

<h3 class=fn>void <a name="setOutputToFile"></a>QPrinter::setOutputToFile ( bool&nbsp;enable )<tt> [virtual]</tt>
</h3>
Specifies whether the output should be written to a file or sent
directly to the printer.
<p> Will output to a file if <em>enable</em> is TRUE, or will output directly
to the printer if <em>enable</em> is FALSE.
<p> This function is currently only supported under X11.
<p> <p>See also <a href="#outputToFile">outputToFile</a>() and <a href="#setOutputFileName">setOutputFileName</a>().

<h3 class=fn>void <a name="setPageOrder"></a>QPrinter::setPageOrder ( <a href="qprinter.html#PageOrder-enum">PageOrder</a>&nbsp;newPageOrder )<tt> [virtual]</tt>
</h3>  Sets the page order to <em>newPageOrder</em>.
<p> The page order can be <a href="#PageOrder-enum">QPrinter::FirstPageFirst</a> or <a href="#PageOrder-enum">QPrinter::LastPageFirst</a>.  The application programmer is responsible
for reading the page order and printing accordingly.
<p> This function is useful mostly for setting a default value that the
user can override in the print dialog when you call <a href="#setup">setup</a>().

<h3 class=fn>void <a name="setPageSize"></a>QPrinter::setPageSize ( <a href="qprinter.html#PageSize-enum">PageSize</a>&nbsp;newPageSize )<tt> [virtual]</tt>
</h3>  Sets the printer page size to <em>newPageSize</em> if that size is
supported. The result if undefined if <em>newPageSize</em> is not
supported.
<p> The default page size is system-dependent.
<p> This function is useful mostly for setting a default value that the
user can override in the print dialog when you call <a href="#setup">setup</a>().
<p> <p>See also <a href="#pageSize">pageSize</a>(), <a href="#PageSize-enum">PageSize</a>, <a href="#setFullPage">setFullPage</a>() and <a href="#setResolution">setResolution</a>().

<h3 class=fn>void <a name="setPaperSource"></a>QPrinter::setPaperSource ( <a href="qprinter.html#PaperSource-enum">PaperSource</a>&nbsp;source )<tt> [virtual]</tt>
</h3> Sets the paper source setting to <em>source</em>.
<p> <p>See also <a href="#paperSource">paperSource</a>().

<h3 class=fn>void <a name="setPrintProgram"></a>QPrinter::setPrintProgram ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;printProg )<tt> [virtual]</tt>
</h3>
Sets the name of the program that should do the print job to <em>printProg</em>.
<p> On X11, this function sets the program to call with the PostScript
output.  On other platforms, it has no effect.
<p> <p>See also <a href="#printProgram">printProgram</a>().

<h3 class=fn>void <a name="setPrinterName"></a>QPrinter::setPrinterName ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name )<tt> [virtual]</tt>
</h3>
Sets the printer name to <em>name</em>.
<p> The default printer will be used if no printer name is set.
<p> Under X11, the PRINTER environment variable defines the
default printer.  Under any other window system, the window
system defines the default printer.
<p> <p>See also <a href="#printerName">printerName</a>().

<h3 class=fn>void <a name="setPrinterSelectionOption"></a>QPrinter::setPrinterSelectionOption ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;option )<tt> [virtual]</tt>
</h3>  Sets the printer to use <em>option</em> to select the printer.  <em>option</em>
is null by default (which implies that Qt should be smart enough to
guess correctly), but it can be set to other values to use a specific
printer selection option.
<p> If the printer selection option is changed while the printer is
active, the current print job may or may not be affected.
<p> <p>See also <a href="#printerSelectionOption">printerSelectionOption</a>().

<h3 class=fn>void <a name="setResolution"></a>QPrinter::setResolution ( int&nbsp;dpi )<tt> [virtual]</tt>
</h3> Requests that the printer prints at <em>dpi</em> or as near to <em>dpi</em> as
possible.
<p> This setting affects the coordinate system as returned by
e.g. <a href="qpaintdevicemetrics.html">QPaintDeviceMetrics</a> and <a href="qpainter.html#viewport">QPainter::viewport</a>().
<p> The value depends on the PrintingMode used in the QPrinter constructor.
By default, the dpi value of the screen is used.
<p> This function must be called before <a href="#setup">setup</a>() to have an effect on all platforms.
<p> <p>See also <a href="#resolution">resolution</a>() and <a href="#setPageSize">setPageSize</a>().

<h3 class=fn>bool <a name="setup"></a>QPrinter::setup ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0 )
</h3>
Opens a printer setup dialog, with parent <em>parent</em>, and asks the
user to specify what printer to use and miscellaneous printer
settings.
<p> Returns TRUE if the user pressed "OK" to print, or FALSE if the
user cancelled the operation.

<p>Examples: <a href="qaction-application-example.html#x2037">action/application.cpp</a>, <a href="simple-application-example.html#x1935">application/application.cpp</a>, <a href="drawdemo-example.html#x1646">drawdemo/drawdemo.cpp</a>, <a href="helpviewer-example.html#x1414">helpviewer/helpwindow.cpp</a> and <a href="mdi-example.html#x1169">mdi/application.cpp</a>.
<h3 class=fn>int <a name="toPage"></a>QPrinter::toPage () const
</h3>

<p> Returns the to-page setting.  The default value is 0.
<p> If <a href="#fromPage">fromPage</a>() and <a href="#toPage">toPage</a>() both return 0 this should signify 'print
the whole document'.
<p> The programmer is responsible for reading this setting and printing
accordingly.
<p> <p>See also <a href="#setFromTo">setFromTo</a>() and <a href="#fromPage">fromPage</a>().

<h3 class=fn>short <a name="winPageSize"></a>QPrinter::winPageSize () const
</h3>
Returns the Windows page size value as used by the DEVMODE struct
(Windows only). Using this function is not portable.
<p> Use <a href="#pageSize">pageSize</a>() to get the <a href="#PageSize-enum">PageSize</a>, e.g. 'A4', 'Letter', etc.

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2001
<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 &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>