📄 qprinter.html
字号:
<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 bitsmaller; 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; itjust uses this information to try and set the paper source.Whether it will set the paper source depends on whether theprinter 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. Itbasically presets a certain resolution and working mode.<ul><li><tt>QPrinter::ScreenResolution</tt> - Sets the resolution of the print device tothe screen resolution. This has the big advantage that the resultsobtained when painting on the printer will match more or lessexactly the visible output on the screen. It is the easiest touse, as font metrics on the screen and on the printer are thesame. This is the default value.<li><tt>QPrinter::PrinterResolution</tt> - Use the physical resolution of theprinter on Windows. On Unix, set the postscript resolution to 72dpi.<li><tt>QPrinter::HighResolution</tt> - Use printer resolution on windows, set theresolution of the postscript driver to 600dpi.<li><tt>QPrinter::Compatible</tt> - Almost the same as PrinterResolution, but keepssome peculiarities of the Qt 2.x printer driver. This is usefulfor applications ported from Qt 2.x to Qt 3.x.</ul><hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QPrinter"></a>QPrinter::QPrinter ( <a href="qprinter.html#PrinterMode-enum">PrinterMode</a> 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; otherwisereturns FALSE.<p> <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 returnsFALSE.<p> <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> <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> <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 signifies 'print thewhole document'.<p> The programmer is responsible for reading this setting andprinting 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 isat the corner of the sheet and FALSE if it is at the edge of theprintable 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 margin and the height of the topmargin of the printer. On Unix, this is a best-effort guess, notbased on perfect knowledge.<p> If you have called <a href="#setFullPage">setFullPage</a>( TRUE ), <a href="#margins">margins</a>().width() may betreated as the smallest sane left/right margin you can use, andmargins().height() as the smallest sane top/bottom margins you canuse.<p> If you have called setFullPage( FALSE ) (this is the default),margins() is automatically subtracted from the <a href="#pageSize">pageSize</a>() byQPrinter.<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 pagenumber than <a href="#maxPage">maxPage</a>() when they select a print range. The defaultvalue is 0.<p> <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 useris allowed to choose. The default value is 0.<p> <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 returns FALSE.<p>Examples: <a href="qaction-application-example.html#x1085">action/application.cpp</a>, <a href="simple-application-example.html#x1530">application/application.cpp</a>, <a href="helpviewer-example.html#x1007">helpviewer/helpwindow.cpp</a> and <a href="mdi-example.html#x2033">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> <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> <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><p> Returns the name of the output file. There is no default filename.<p> <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 FALSEif the output should be sent directly to the printer. The defaultsetting 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 <a href="#PageOrder-enum">FirstPageFirst</a>.<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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -