![]() 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(const QPrinterInfo & printer, QPrinter::PrinterMode mode = ScreenResolution)Ĭreates a new printer object with the given printer and mode. Member Function Documentation QPrinter:: QPrinter( QPrinter::PrinterMode mode = ScreenResolution)Ĭreates a new printer object with the given 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). setCop圜ount() tells QPrinter how many copies of the document it should print.setFullPage() tells QPrinter whether you want to deal with the full page or just with the part the printer can draw on.setResolution() tells QPrinter what resolution you wish the printer to provide, in dots per inch (DPI).setPageLayout() tells QPrinter which page orientation to use, and what size to expect from the printer.In general, QPrinter passes these functions onto the underlying QPrintEngine. QPrinter supports a number of parameters, most of which can be changed by the end user through a print dialog. ![]() ![]() You can use QPrinter::isValid() to verify this before changing any parameters. Note that setting parameters like paper size and resolution on an invalid printer is undefined. As an alternative, the printProgram() function can be used to specify the command or utility to use instead of the system default. On X11, QPrinter uses the Common Unix Printing System (CUPS) to send PDF output to the printer. When printing directly to a printer on Windows or macOS, QPrinter uses the built-in printer drivers. A set of additional functions are provided to manage device-specific features, such as orientation and resolution, and to step through the pages in a document as it is generated. This device represents a series of pages of printed output, and is used in almost exactly the same way as other paint devices such as QWidget and QPixmap. SetPrinterSelectionOption(const QString & option) SetPrintRange(QPrinter::PrintRange range) SetPrintProgram(const QString & printProg) SetPdfVersion(QPagedPaintDevice::PdfVersion version) SetPaperSource(QPrinter::PaperSource source) SetPageOrder(QPrinter::PageOrder pageOrder) SetOutputFormat(QPrinter::OutputFormat format) SetOutputFileName(const QString & fileName) SetColorMode(QPrinter::ColorMode newColorMode) QPrinter(const QPrinterInfo & printer, QPrinter::PrinterMode mode = ScreenResolution) QPrinter(QPrinter::PrinterMode mode = ScreenResolution)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |