QPrinter::ColorMode QPrinter:: colorMode() const With collating turned on all pages are printed before the next copy of those pages is started. When collating is turned off the printing of each individual page will be repeated the numCopies() amount before the next page is started. Returns false if it is turned off when multiple copies is selected. Returns true if collation is turned on when multiple copies is selected. For example, all the data has gone to the printer but the printer cannot or will not cancel the job when asked to. It is not always possible to abort a print job. Returns true if the print run was successfully aborted and printerState() will return QPrinter::Aborted otherwise returns false. bool QPrinter:: abort()Īborts the current print run. If the printer is destroyed while a print job is in progress this may or may not affect the print job. QPrinter:: ~QPrinter()ĭestroys the printer object and frees any allocated resources. QPrinter:: QPrinter( QPrinter::PrinterMode mode = ScreenResolution)Ĭreates a new printer object with the given mode. Member Function Documentation QPrinter:: QPrinter(const QPrinterInfo & printer, QPrinter::PrinterMode mode = ScreenResolution)Ĭreates a new printer object with the given printer and mode. See also QPrintDialog and Qt Print Support. Since QPrinter can print to any QPrintEngine subclass, it is possible to extend printing support to cover new types of printing subsystem by subclassing QPrintEngine and reimplementing its interface. It may cancel the entire job or just part of it. If you want to abort the print job, abort() will try its best to stop printing. Similarly, calling newPage() after the last page in a document is painted will result in a trailing blank page appended to the end of the printed document. You only need to calling newPage() after QPainter::begin() if you need to insert a blank page at the beginning of a printed document. The first page in a document does not need to be preceded by a call to newPage(). The second page and all following pages are prepared using a call to newPage() before they are painted. Once the first page has been painted, newPage() can be called to request a new blank page to paint on, or QPainter::end() can be called to finish printing. When QPainter::begin() is called, the QPrinter it operates on is prepared for a new page, enabling the QPainter to be used immediately to paint the first page in a document. See QAbstractPrintDialog's documentation for more details. There are also some settings that the user sets (through the printer dialog) and that applications are expected to obey. This usually makes sense because, for example, it's not possible to change the number of copies when you are halfway through printing. Many of these functions can only be called before the actual printing begins (i.e., before QPainter::begin() is called).
0 Comments
Leave a Reply. |