, \li setOrientation() tells QPrinter which page orientation to use. , \li setPaperSize() tells QPrinter what paper size to expect from the. , printer. On Windows or Mac OS X, QPrinter uses the built-in printer drivers. On X11, QPrinter generates postscript and sends that to lpr, lp, or another printProgram(). 30 Apr In the docs you’ll find QPrinter::printerState. So you can definitely do: if (printer. printerState() == QPrinter::Error) // do some error handling. I admit that’s not a lot.

Author: Tejin Kektilar
Country: Tunisia
Language: English (Spanish)
Genre: Photos
Published (Last): 7 February 2004
Pages: 274
PDF File Size: 10.87 Mb
ePub File Size: 1.82 Mb
ISBN: 295-7-79034-902-8
Downloads: 34740
Price: Free* [*Free Regsitration Required]
Uploader: Maugul

Qt Documentation

Returns the number of copies that will be printed. Returns the page’s rectangle in unit ; this is usually smaller than the paperRect since qpriner page normally has margins between its borders and the paper.

This function was introduced in Qt 4. Color 1 print in color if available, otherwise in grayscale.

Returns true if the origin of the printer’s coordinate system is at the corner of the page and false if it is at the edge of the printable area.

This enum type is used by QPrinter to tell the application program how to print.


If fromPage and toPage both return 0, this indicates that the whole qprnter will be printed. For X11 where all printing is directly to postscript, this function will always return a one item list containing only the postscript resolution, i. The default is to return an empty string; meaning that QPrinter will try to qprinfer smart in a system-dependent way.

DuplexAuto 1 The printer’s default setting is used to determine whether duplex printing is used.

If the printer is destroyed while a print job is in progress this may or may not affect the print job. Returns the paper’s rectangle; this is usually larger than the pageRect.

QPrinter Class Reference

ColorMode, either color or. A4 0 x mm, 8. Due to historic reasons QPageSize:: You can use QPrinter:: The page order can be QPrinter:: This enum type specifies what paper size QPrinter should use.

This is useful only if the print command has been explicitly set.

source code [qtbase/src/printsupport/kernel/] – Woboq Code Browser

This is useful only if the print command has been explicitly set. The common case when creating your own print engine is to derive from both. By default, full page printing is disabled.

An empty file name indicates that the printer should not print to a file. See also resolution and setPaperSize. This function must be called before QPainter:: Returns the current assumed resolution of the printer, as qprunter by setResolution or by the printer driver. AllPages 0 All pages should be printed. Could you drop a minimum working example of what you are doing? This enum was introduced or modified in Qt 4.


qt – Error Handling in QPrinter – Stack Overflow

Setting a non-empty name enables printing to a file. This enum describes the mode the printer should work in. FanFoldGermanLegal if needed.

If the file name. QPrinter does not qprintet ownership of the engines, so you need to manage these engine instances yourself. On Windows and Mac OS X, this option can be changed while printing and will take effect from the next call to newPage.

B4 19 x mm QPrinter:: On X11, this function sets the program to call with the PostScript output.

This function is not portable so you may prefer to use setPageSize instead.