📄 qprinter.3qt
字号:
.TP\fCQPrinter::C5E\fR (163 x 229 mm).TP\fCQPrinter::Comm10E\fR (105 x 241 mm, US Common #10 Envelope).TP\fCQPrinter::DLE\fR (110 x 220 mm).TP\fCQPrinter::Executive\fR (7.5x10 inches, 191x254 mm).TP\fCQPrinter::Folio\fR (210 x 330 mm).TP\fCQPrinter::Ledger\fR (432 x 279 mm).TP\fCQPrinter::Legal\fR (8.5x14 inches, 216x356 mm).TP\fCQPrinter::Letter\fR (8.5x11 inches, 216x279 mm).TP\fCQPrinter::Tabloid\fR (279 x 432 mm).PPWith setFullPage( FALSE ) (the default), the metrics will be a bit smaller. How much depends on the printer in use..SH MEMBER FUNCTION DOCUMENTATION.SH "QPrinter::QPrinter ()"Constructs a printer paint device..SH "QPrinter::~QPrinter ()"Destructs the printer paint device and cleans up..SH "bool QPrinter::abort ()"Aborts the print job. Returns TRUE if successful, otherwise FALSE..PPSee also aborted()..SH "bool QPrinter::aborted () const"Returns TRUE is the printer job was aborted, otherwise FALSE..PPSee also abort()..SH "QPrinter::ColorMode QPrinter::colorMode() const"Returns the current color mode. The default color mode is \fCColor.\fR.PPSee also setColorMode()..SH "QString QPrinter::creator () const"Returns the creator name..PPSee also setCreator()..SH "QString QPrinter::docName () const"Returns the document name..PPSee also setDocName()..SH "int QPrinter::fromPage () const"Returns the from-page setting. The default value is 0..PPThe programmer is responsible for reading this setting and print accordingly..PPSee also setFromTo() and toPage()..SH "bool QPrinter::fullPage () const"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..PPSee setFullPage() for more detail and some warnings..PPSee also setFullPage(), PageSize and QPaintDeviceMetrics..SH "QSize QPrinter::margins () const"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..PPIf you have called setFullPage( TRUE ) (this is recommended for high-quality printing), margins().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..PPIf you have called setFullPage( FALSE ) (this is the default), margins() is automatically subtracted from the pageSize() by QPrinter..PPSee also setFullPage(), QPaintDeviceMetrics and PageSize..SH "int QPrinter::maxPage () const"Returns the max-page setting. The default value is 0..PPSee also minPage() and setMinMax()..SH "int QPrinter::metric ( int m ) const \fC[virtual protected]\fR"Internal implementation of the virtual QPaintDevice::metric() function..PPUse the QPaintDeviceMetrics class instead..PPReimplemented from QPaintDevice..SH "int QPrinter::minPage () const"Returns the min-page setting. The default value is 0..PPSee also maxPage() and setMinMax()..SH "bool QPrinter::newPage ()"Advances to a new page on the printer. Returns TRUE if successful, otherwise FALSE..SH "int QPrinter::numCopies () const"Returns the number of copies to be printed. The default value is 1..PPSee also setNumCopies()..SH "Orientation QPrinter::orientation () const"Returns the orientation setting. The default value is \fCQPrinter::Portrait.\fR.PPSee also setOrientation()..SH "QString QPrinter::outputFileName () const"Returns the name of the output file. There is no default file name..PPSee also setOutputFileName() and setOutputToFile()..SH "bool QPrinter::outputToFile () const"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..PPThis function is currently only supported under X11..PPSee also setOutputToFile() and setOutputFileName()..SH "QPrinter::PageOrder QPrinter::pageOrder() const"Returns the current page order..PPThe default page order is \fIFirstPageFirst.\fR.SH "PageSize QPrinter::pageSize () const"Returns the printer page size. The default value is system-dependent..PPSee also setPageSize()..SH "QString QPrinter::printProgram () const"Returns the name of the program that sends the print output to the printer..PPThe 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..PPOn Windows, this function returns the name of the printer device driver..PPSee also setPrintProgram() and setPrinterSelectionOption()..SH "QString QPrinter::printerName () const"Returns the printer name. This value is initially set to the name of the default printer..PPSee also setPrinterName()..SH "QString QPrinter::printerSelectionOption () const"Returns the printer options selection string. This is only useful if the print command has been explicitly set..PPThe default value (a null string) implies to select printer in a system-dependent manner..PPAny other value implies to use that value..PPSee also setPrinterSelectionOption()..SH "void QPrinter::setColorMode ( ColorMode newColorMode )"Sets the printer's color mode to \fInewColorMode,\fR which can be one of \fCColor\fR (the default) and \fCGrayScale.\fR.PPA future version of Qt will modify its printing accordingly. At present, QPrinter behaves as if \fCColor\fR is selected..PPSee also colorMode()..SH "void QPrinter::setCreator ( const QString & creator ) \fC[virtual]\fR"Sets the creator name..PPCalling this function only has effect for the X11 version of Qt. The creator name is the name of the application that created the document. If no creator name is specified, then the creator will be set to "Qt" with some version number..PPSee also creator()..SH "void QPrinter::setDocName ( const QString & name ) \fC[virtual]\fR"Sets the document name..SH "void QPrinter::setFromTo ( int fromPage, int toPage ) \fC[virtual]\fR"Sets the from page and to page..PPThe from-page and to-page settings specify what pages to print..PPThis function is useful mostly for setting a default value that the user can override in the print dialog when you call setup()..PPSee also fromPage(), toPage(), setMinMax() and setup()..SH "void QPrinter::setFullPage ( bool fp ) \fC[virtual]\fR"Sets QPrinter to have the origin of the coordinate system at the top left corner of the paper if \fIfp\fR is TRUE, or where it thinks the top left corner of the printable area is if \fIfp\fR is FALSE..PPThe default is FALSE: You can (probably) print on (0,0), and QPaintDeviceMetrics 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.).PPIf you set it 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..PPIf the page-size mode is changed while the printer is active, the current print job may or may not be affected..PPSee also PageSize, setPageSize(), QPaintDeviceMetrics and fullPage()..SH "void QPrinter::setMinMax ( int minPage, int maxPage ) \fC[virtual]\fR"Sets the min page and max page..PPThe min-page and max-page restrict the from-page and to-page settings. When the printer setup dialog comes up, the user cannot select from and to that are outside the range specified by min and max pages..PPSee also minPage(), maxPage(), setFromTo() and setup()..SH "void QPrinter::setNumCopies ( int numCopies ) \fC[virtual]\fR"Sets the number of pages to be printed..PPThe printer driver reads this setting and prints the specified number of copies..PPSee also numCopies() and setup()..SH "void QPrinter::setOrientation ( Orientation orientation )"Sets the print orientation..PPThe orientation can be either \fCQPrinter::Portrait\fR or \fCQPrinter::Landscape.\fR.PPThe 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 QPrinter::setup() )..PPSee also orientation()..SH "void QPrinter::setOutputFileName ( const QString & fileName ) \fC[virtual]\fR"Sets the name of the output file..PPSetting a null name (0 or "") disables output to a file, i.e. calls setOutputToFile(FALSE); Setting non-null name enables output to a file, i.e. calls setOutputToFile(TRUE)..PPThis function is currently only supported under X11..PPSee also outputFileName() and setOutputToFile()..SH "void QPrinter::setOutputToFile ( bool enable ) \fC[virtual]\fR"Specifies whether the output should be written to a file or sent directly to the printer..PPWill output to a file if \fIenable\fR is TRUE, or will output directly to the printer if \fIenable\fR is FALSE..PPThis function is currently only supported under X11..PPSee also outputToFile() and setOutputFileName()..SH "void QPrinter::setPageOrder ( PageOrder newPageOrder )"Sets the page order to \fInewPageOrder.\fR.PPThe page order can be \fCQPrinter::FirstPageFirst\fR or \fCQPrinter::LastPageFirst.\fR The application programmer is responsible for reading the page order and printing accordingly..PPThis function is useful mostly for setting a default value that the user can override in the print dialog when you call setup()..SH "void QPrinter::setPageSize ( PageSize newPageSize )"Sets the printer page size to \fInewPageSize.\fR.PPThe default page size is system-dependent..PPThis function is useful mostly for setting a default value that the user can override in the print dialog when you call setup()..PPSee also pageSize(), PageSize and setFullPage()..SH "void QPrinter::setPrintProgram ( const QString & printProg ) \fC[virtual]\fR"Sets the name of the program that should do the print job..PPOn X11, this function sets the program to call with the PostScript output. On other platforms, it has no effect..PPSee also printProgram()..SH "void QPrinter::setPrinterName ( const QString & name ) \fC[virtual]\fR"Sets the printer name..PPThe default printer will be used if no printer name is set..PPUnder X11, the PRINTER environment variable defines the default printer. Under any other window system, the window system defines the default printer..PPSee also printerName()..SH "void QPrinter::setPrinterSelectionOption ( const QString & option ) \fC[virtual]\fR"Sets the printer to use \fIoption\fR to select printer. \fIoption\fR is null by default, meaning to be a little smart, but can be set to other values to use a specific printer selection option..PPIf the printer selection option is changed while the printer is active, the current print job may or may not be affected..SH "bool QPrinter::setup ( QWidget * = 0 )"Opens a printer setup dialog and asks the user to specify what printer to use and miscellaneous printer settings..PPReturns TRUE if the user pressed "OK" to print, or FALSE if the user cancelled the operation..PPExamples:.(ldrawdemo/drawdemo.cpp.)l.SH "int QPrinter::toPage () const"Returns the to-page setting. The default value is 0..PPThe programmer is responsible for reading this setting and print accordingly..PPSee also setFromTo() and fromPage()..SH "bool QPrinter::cmd ( int c, QPainter * paint, QPDevCmdParam * p ) \fC[virtual protected]\fR"For internal use only..PPReimplemented from QPaintDevice..SH "SEE ALSO".BR http://doc.trolltech.com/qprinter.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qprinter.3qt) and the Qtversion (2.3.0).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -