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

📄 qprinter.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QPrinter 3qt "11 October 2001" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQPrinter \- Paint device that paints on a printer.PP\fC#include <qprinter.h>\fR.PPInherits QPaintDevice..PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBPrinterMode\fR { ScreenResolution, PrinterResolution, HighResolution, Compatible }".br.ti -1c.BI "\fBQPrinter\fR ( PrinterMode m = ScreenResolution )".br.ti -1c.BI "\fB~QPrinter\fR ()".br.ti -1c.BI "enum \fBOrientation\fR { Portrait, Landscape }".br.ti -1c.BI "enum \fBPageSize\fR { 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 }".br.ti -1c.BI "enum \fBPageOrder\fR { FirstPageFirst, LastPageFirst }".br.ti -1c.BI "enum \fBColorMode\fR { GrayScale, Color }".br.ti -1c.BI "enum \fBPaperSource\fR { OnlyOne, Lower, Middle, Manual, Envelope, EnvelopeManual, Auto, Tractor, SmallFormat, LargeFormat, LargeCapacity, Cassette, FormSource }".br.ti -1c.BI "QString \fBprinterName\fR () const".br.ti -1c.BI "virtual void \fBsetPrinterName\fR ( const QString & name )".br.ti -1c.BI "bool \fBoutputToFile\fR () const".br.ti -1c.BI "virtual void \fBsetOutputToFile\fR ( bool enable )".br.ti -1c.BI "QString \fBoutputFileName\fR () const".br.ti -1c.BI "virtual void \fBsetOutputFileName\fR ( const QString & fileName )".br.ti -1c.BI "QString \fBprintProgram\fR () const".br.ti -1c.BI "virtual void \fBsetPrintProgram\fR ( const QString & printProg )".br.ti -1c.BI "QString \fBprinterSelectionOption\fR () const".br.ti -1c.BI "virtual void \fBsetPrinterSelectionOption\fR ( const QString & option )".br.ti -1c.BI "QString \fBdocName\fR () const".br.ti -1c.BI "virtual void \fBsetDocName\fR ( const QString & name )".br.ti -1c.BI "QString \fBcreator\fR () const".br.ti -1c.BI "virtual void \fBsetCreator\fR ( const QString & creator )".br.ti -1c.BI "Orientation \fBorientation\fR () const".br.ti -1c.BI "virtual void \fBsetOrientation\fR ( Orientation orientation )".br.ti -1c.BI "PageSize \fBpageSize\fR () const".br.ti -1c.BI "virtual void \fBsetPageSize\fR ( PageSize newPageSize )".br.ti -1c.BI "short \fBwinPageSize\fR () const".br.ti -1c.BI "virtual void \fBsetPageOrder\fR ( PageOrder newPageOrder )".br.ti -1c.BI "PageOrder \fBpageOrder\fR () const".br.ti -1c.BI "virtual void \fBsetResolution\fR ( int dpi )".br.ti -1c.BI "virtual int \fBresolution\fR () const".br.ti -1c.BI "virtual void \fBsetColorMode\fR ( ColorMode newColorMode )".br.ti -1c.BI "ColorMode \fBcolorMode\fR () const".br.ti -1c.BI "virtual void \fBsetFullPage\fR ( bool fp )".br.ti -1c.BI "bool \fBfullPage\fR () const".br.ti -1c.BI "QSize \fBmargins\fR () const".br.ti -1c.BI "int \fBfromPage\fR () const".br.ti -1c.BI "int \fBtoPage\fR () const".br.ti -1c.BI "virtual void \fBsetFromTo\fR ( int fromPage, int toPage )".br.ti -1c.BI "int \fBminPage\fR () const".br.ti -1c.BI "int \fBmaxPage\fR () const".br.ti -1c.BI "virtual void \fBsetMinMax\fR ( int minPage, int maxPage )".br.ti -1c.BI "int \fBnumCopies\fR () const".br.ti -1c.BI "virtual void \fBsetNumCopies\fR ( int numCopies )".br.ti -1c.BI "bool \fBnewPage\fR ()".br.ti -1c.BI "bool \fBabort\fR ()".br.ti -1c.BI "bool \fBaborted\fR () const".br.ti -1c.BI "bool \fBsetup\fR ( QWidget * parent = 0 )".br.ti -1c.BI "PaperSource \fBpaperSource\fR () const".br.ti -1c.BI "virtual void \fBsetPaperSource\fR ( PaperSource source )".br.in -1c.SH DESCRIPTIONThe QPrinter class is a paint device that paints on a printer..PPOn Windows it uses the built-in printer drivers. On X11 it generates postscript and sends that to lpr, lp, or another print command..PPQPrinter is used much the same way as QWidget and QPixmap are used. The big difference is that you must keep track of the pages..PPQPrinter supports a number of settable parameters, most of which can be changed by the end user when the application calls QPrinter::setup()..PPThe most important parameters are:.TPsetOrientation() tells QPrinter which page orientation to use (virtual)..TPsetPageSize() tells QPrinter what page size to expect from the printer..TPsetResolution() tells QPrinter what resolution you wish the printer to provide (in dpi)..TPsetFullPage() 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..IP.TPsetNumCopies() tells QPrinter how many copies of the document it should print..TPsetMinMax() tells QPrinter and QPrintDialog what the allowed range for fromPage() and toPage() are..PPExcept where noted, you can only call the set functions before setup(), or between QPainter::end() 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.).PPThere are also some settings that the user sets (through the printer dialog) and that applications are expected to obey:.IP.TPpageOrder() tells the application program whether to print first-page-first or last-page-first..IP.TPcolorMode() 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.).IP.TPfromPage() and toPage() indicate what pages the application program should print..IP.TPpaperSource() tells the application progam which paper source to print from..IP.PPYou can of course call these functions to establish defaults before you ask the user through QPrinter::setup()..PPOnce you start printing, newPage() is essential. You will probably also need to look at the QPaintDeviceMetrics for the printer (see the print function in the Application walk-through). Note that the paint device metrics are valid only after the QPrinter has been set up, i.e. after setup() has returned successfully. If you want high-quality printing with accurate margins, it is essential to call setFullPage(TRUE)..PPIf you want to abort the print job, abort() will try its best to stop printing. It may cancel the entire job or just some of it..PPThe true type font embedding for Qt's post script driver uses code by David Chappell of Trinity College Computing Center..PPCopyright 1995, Trinity College Computing Center. Written by David Chappell..PPPermission 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..PPTrueType font support. These functions allow PPR to generate PostScript fonts from Microsoft compatible TrueType font files..PPThe functions in this file do most of the work to convert a TrueType font to a type 3 PostScript font..PPMost 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..PPLast revised 11 July 1995..PPSee also Graphics Classes and Image Processing Classes..SS "Member Type Documentation".SH "QPrinter::ColorMode"This enum type is used to indicate whether QPrinter should print in color or not. The possible values are:.TP\fCQPrinter::Color\fR - print in color if available, otherwise in grayscale. This is the default..TP\fCQPrinter::GrayScale\fR - print in grayscale, even on color printers. Might be a little faster than Color..SH "QPrinter::Orientation"This enum type (not to be confused with Qt::Orientation) is used to specify each page's orientation..TP\fCQPrinter::Portrait\fR - the page's height is greater than its width (the default)..TP\fCQPrinter::Landscape\fR - the page's width is greater than its height..PPThis type interacts with QPrinter::PageSize and QPrinter::setFullPage() to determine the final size of the page available to the application..SH "QPrinter::PageOrder"This enum type is used by QPrinter to tell the application program how to print. The possible values are.TP\fCQPrinter::FirstPageFirst\fR - the lowest-numbered page should be printed first..TP\fCQPrinter::LastPageFirst\fR - the highest-numbered page should be printed first..SH "QPrinter::PageSize"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 QPrinter::setFullPage(), to determine the printable area (see QPaintDeviceMetrics)..PPThe defined sizes (with setFullPage(TRUE)) are:.TP\fCQPrinter::A0\fR - 841 x 1189 mm.TP\fCQPrinter::A1\fR - 594 x 841 mm.TP\fCQPrinter::A2\fR - 420 x 594 mm.TP\fCQPrinter::A3\fR - 297 x 420 mm.TP\fCQPrinter::A4\fR - 210 x 297 mm, 8.26 x 11.7 inches.TP\fCQPrinter::A5\fR - 148 x 210 mm.TP\fCQPrinter::A6\fR - 105 x 148 mm.TP\fCQPrinter::A7\fR - 74 x 105 mm.TP\fCQPrinter::A8\fR - 52 x 74 mm.TP\fCQPrinter::A9\fR - 37 x 52 mm.TP\fCQPrinter::B0\fR - 1030 x 1456 mm.TP\fCQPrinter::B1\fR - 728 x 1030 mm.TP\fCQPrinter::B10\fR - 32 x 45 mm.TP\fCQPrinter::B2\fR - 515 x 728 mm.TP\fCQPrinter::B3\fR - 364 x 515 mm.TP\fCQPrinter::B4\fR - 257 x 364 mm.TP\fCQPrinter::B5\fR - 182 x 257 mm, 7.17 x 10.13 inches.TP\fCQPrinter::B6\fR - 128 x 182 mm.TP\fCQPrinter::B7\fR - 91 x 128 mm.TP\fCQPrinter::B8\fR - 64 x 91 mm.TP\fCQPrinter::B9\fR - 45 x 64 mm.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.5 x 10 inches, 191 x 254 mm.TP\fCQPrinter::Folio\fR - 210 x 330 mm.TP\fCQPrinter::Ledger\fR - 432 x 279 mm.TP\fCQPrinter::Legal\fR - 8.5 x 14 inches, 216 x 356 mm.TP\fCQPrinter::Letter\fR - 8.5 x 11 inches, 216 x 279 mm.TP\fCQPrinter::Tabloid\fR - 279 x 432 mm.TP\fCQPrinter::Custom\fR.TP\fCQPrinter::NPageSize\fR - (internal)

⌨️ 快捷键说明

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