⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qprinter.html

📁 QT 下载资料仅供参考
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<p> Returns the name of the program that sends the print output to theprinter.<p> The default is to return a null string; meaning that QPrinter willtry to be smart in a system-dependent way. On X11 only, you canset it to something different to use a specific print program.<p> On Windows, this function returns the name of the printer devicedriver.<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 nameof 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 onlyif the print command has been explicitly set.<p> The default value (a null string) implies that the printer shouldbe 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 beeither <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 nocreator 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 <a href="#fromPage">fromPage</a>() and <a href="#toPage">toPage</a>() both return 0 this signifies 'print thewhole document'.<p> This function is useful mostly to set a default value that theuser 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 thetop-left corner of the paper if <em>fp</em> is TRUE, or where it thinksthe 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 sizeindicated by PageSize. (Note that QPrinter may be wrong on Unixsystems - it does not have perfect knowledge of the physicalprinter.)<p> If you set <em>fp</em> to TRUE, QPaintDeviceMetrics will report theexact same size as indicated by <a href="#PageSize-enum">PageSize</a>, but you cannot printon all of that - you must take care of the output marginsyourself.<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#x1008">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-pagesettings. When the printer setup dialog appears, the user cannotselect a from page or a to page that are outside the rangespecified 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 specifiednumber 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 thespecified orientation. On Windows this setting won't take effectuntil 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 nameenables 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 sentdirectly to the printer.<p> Will output to a file if <em>enable</em> is TRUE, or will outputdirectly 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 responsiblefor reading the page order and printing accordingly.<p> This function is useful mostly for setting a default value thatthe 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 issupported. The result if undefined if <em>newPageSize</em> is notsupported.<p> The default page size is system-dependent.<p> This function is useful mostly for setting a default value thatthe 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 PostScriptoutput. 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 <tt>PRINTER</tt> environment variable defines the defaultprinter.  Under any other window system, the window system definesthe 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 enoughto guess correctly), but it can be set to other values to use aspecific printer selection option.<p> If the printer selection option is changed while the printer isactive, 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> aspossible.<p> This setting affects the coordinate system as returned by, forexample, <a href="qpaintdevicemetrics.html">QPaintDeviceMetrics</a> and <a href="qpainter.html#viewport">QPainter::viewport</a>().<p> The value depends on the <tt>PrintingMode</tt> used in the QPrinterconstructor. 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 onall 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 theuser to specify which printer they wish to use and what settingsit should have.<p> Returns TRUE if the user pressed "OK" to print, or FALSE if theuser cancelled the operation.<p>Examples: <a href="qaction-application-example.html#x1086">action/application.cpp</a>, <a href="simple-application-example.html#x1531">application/application.cpp</a>, <a href="drawdemo-example.html#x1180">drawdemo/drawdemo.cpp</a>, <a href="helpviewer-example.html#x1009">helpviewer/helpwindow.cpp</a> and <a href="mdi-example.html#x2034">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 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="#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 <tt>DEVMODE</tt>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-2002<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; 2002 <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.5</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -