- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Friends

# QPrinter Class Reference

Search for all occurrences

## Detailed Description

Definition at line 66 of file qprinter.h.

`#include <qprinter.h>`

Inheritance diagram for QPrinter:
[legend]

List of all members.

## Public Types
enum | PrinterMode { ScreenResolution, PrinterResolution, HighResolution }
enum | Orientation { Portrait, Landscape }
enum | PageSize { 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, NPaperSize = Custom }
enum | PageOrder { FirstPageFirst, LastPageFirst }
enum | ColorMode { GrayScale, Color }
enum | PaperSource { OnlyOne, Lower, Middle, Manual, Envelope, EnvelopeManual, Auto, Tractor, SmallFormat, LargeFormat, LargeCapacity, Cassette, FormSource, MaxPageSource }
enum | PrinterState { Idle, Active, Aborted, Error }
enum | OutputFormat { NativeFormat, PdfFormat, PostScriptFormat }
enum | PrintRange { AllPages, Selection, PageRange, CurrentPage }
enum | Unit { Millimeter, Point, Inch, Pica, Didot, Cicero, DevicePixel }
enum | DuplexMode { DuplexNone = 0, DuplexAuto, DuplexLongSide, DuplexShortSide }
typedef PageSize | PaperSize
## Public Member Functions
| QPrinter (PrinterMode mode=ScreenResolution)
| QPrinter (const QPrinterInfo &printer, PrinterMode mode=ScreenResolution)
| ~QPrinter ()
int | devType () const
void | setOutputFormat (OutputFormat format)
OutputFormat | outputFormat () const
void | setPrinterName (const QString &)
QString | printerName () const
bool | isValid () const
void | setOutputFileName (const QString &)
QString | outputFileName () const
void | setPrintProgram (const QString &)
QString | printProgram () const
void | setDocName (const QString &)
QString | docName () const
void | setCreator (const QString &)
QString | creator () const
void | setOrientation (Orientation)
Orientation | orientation () const
void | setPageSize (PageSize)
PageSize | pageSize () const
void | setPaperSize (PaperSize)
PaperSize | paperSize () const
void | setPaperSize (const QSizeF &paperSize, Unit unit)
QSizeF | paperSize (Unit unit) const
void | setPageOrder (PageOrder)
PageOrder | pageOrder () const
void | setResolution (int)
int | resolution () const
void | setColorMode (ColorMode)
ColorMode | colorMode () const
void | setCollateCopies (bool collate)
bool | collateCopies () const
void | setFullPage (bool)
bool | fullPage () const
void | setNumCopies (int)
int | numCopies () const
int | actualNumCopies () const
void | setCopyCount (int)
int | copyCount () const
bool | supportsMultipleCopies () const
void | setPaperSource (PaperSource)
PaperSource | paperSource () const
void | setDuplex (DuplexMode duplex)
DuplexMode | duplex () const
QList< int > | supportedResolutions () const
void | setFontEmbeddingEnabled (bool enable)
bool | fontEmbeddingEnabled () const
void | setDoubleSidedPrinting (bool enable)
bool | doubleSidedPrinting () const
QRect | paperRect () const
QRect | pageRect () const
QRectF | paperRect (Unit) const
QRectF | pageRect (Unit) const
QString | printerSelectionOption () const
void | setPrinterSelectionOption (const QString &)
bool | newPage ()
bool | abort ()
PrinterState | printerState () const
QPaintEngine * | paintEngine () const
QPrintEngine * | printEngine () const
void | setFromTo (int fromPage, int toPage)
int | fromPage () const
int | toPage () const
void | setPrintRange (PrintRange range)
PrintRange | printRange () const
void | setPageMargins (qreal left, qreal top, qreal right, qreal bottom, Unit unit)
void | getPageMargins (qreal *left, qreal *top, qreal *right, qreal *bottom, Unit unit) const
## Protected Member Functions
int | metric (PaintDeviceMetric) const
void | setEngines (QPrintEngine *printEngine, QPaintEngine *paintEngine)
## Friends
class | QPrintDialogPrivate
class | QAbstractPrintDialog
class | QAbstractPrintDialogPrivate
class | QPrintPreviewWidgetPrivate
class | QTextDocument
class | QPageSetupWidget

## Member Typedef Documentation

typedef PageSize PaperSize

Search for all occurrences

Definition at line 85 of file qprinter.h.

## Member Enumeration Documentation

enum PrinterMode

Search for all occurrences

Enumerator:

  ScreenResolution | Search for all occurrences
  PrinterResolution | Search for all occurrences
  HighResolution | Search for all occurrences

Definition at line 70 of file qprinter.h.

    { ScreenResolution, PrinterResolution, HighResolution };

enum Orientation

Search for all occurrences

Enumerator:

  Portrait | Search for all occurrences
  Landscape | Search for all occurrences

Definition at line 78 of file qprinter.h.

    { Portrait, Landscape };

enum PageSize

Search for all occurrences

Enumerator:

  A4 | Search for all occurrences
  B5 | Search for all occurrences
  Letter | Search for all occurrences
  Legal | Search for all occurrences
  Executive | Search for all occurrences
  A0 | Search for all occurrences
  A1 | Search for all occurrences
  A2 | Search for all occurrences
  A3 | Search for all occurrences
  A5 | Search for all occurrences
  A6 | Search for all occurrences
  A7 | Search for all occurrences
  A8 | Search for all occurrences
  A9 | Search for all occurrences
  B0 | Search for all occurrences
  B1 | Search for all occurrences
  B10 | Search for all occurrences
  B2 | Search for all occurrences
  B3 | Search for all occurrences
  B4 | Search for all occurrences
  B6 | Search for all occurrences
  B7 | Search for all occurrences
  B8 | Search for all occurrences
  B9 | Search for all occurrences
  C5E | Search for all occurrences
  Comm10E | Search for all occurrences
  DLE | Search for all occurrences
  Folio | Search for all occurrences
  Ledger | Search for all occurrences
  Tabloid | Search for all occurrences
  Custom | Search for all occurrences
  NPageSize | Search for all occurrences
  NPaperSize | Search for all occurrences

Definition at line 81 of file qprinter.h.

                      { 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, NPaperSize = Custom };

enum PageOrder

Search for all occurrences

Enumerator:

  FirstPageFirst | Search for all occurrences
  LastPageFirst | Search for all occurrences

Definition at line 97 of file qprinter.h.

                         { FirstPageFirst,
                           LastPageFirst };

enum ColorMode

Search for all occurrences

Enumerator:

  GrayScale | Search for all occurrences
  Color | Search for all occurrences

Definition at line 100 of file qprinter.h.

                         { GrayScale,
                           Color };

enum PaperSource

Search for all occurrences

Enumerator:

  OnlyOne | Search for all occurrences
  Lower | Search for all occurrences
  Middle | Search for all occurrences
  Manual | Search for all occurrences
  Envelope | Search for all occurrences
  EnvelopeManual | Search for all occurrences
  Auto | Search for all occurrences
  Tractor | Search for all occurrences
  SmallFormat | Search for all occurrences
  LargeFormat | Search for all occurrences
  LargeCapacity | Search for all occurrences
  Cassette | Search for all occurrences
  FormSource | Search for all occurrences
  MaxPageSource | Search for all occurrences

Definition at line 103 of file qprinter.h.

                         { OnlyOne,
                           Lower,
                           Middle,
                           Manual,
                           Envelope,
                           EnvelopeManual,
                           Auto,
                           Tractor,
                           SmallFormat,
                           LargeFormat,
                           LargeCapacity,
                           Cassette,
                           FormSource,
                           MaxPageSource
        };

enum PrinterState

Search for all occurrences

Enumerator:

  Idle | Search for all occurrences
  Active | Search for all occurrences
  Aborted | Search for all occurrences
  Error | Search for all occurrences

Definition at line 119 of file qprinter.h.

                          { Idle,
                            Active,
                            Aborted,
                            Error };

enum OutputFormat

Search for all occurrences

Enumerator:

  NativeFormat | Search for all occurrences
  PdfFormat | Search for all occurrences
  PostScriptFormat | Search for all occurrences

Definition at line 124 of file qprinter.h.

    { NativeFormat, PdfFormat, PostScriptFormat };

enum PrintRange

Search for all occurrences

Enumerator:

  AllPages | Search for all occurrences
  Selection | Search for all occurrences
  PageRange | Search for all occurrences
  CurrentPage | Search for all occurrences

Definition at line 127 of file qprinter.h.

    { AllPages, Selection, PageRange, CurrentPage };

enum Unit

Search for all occurrences

Enumerator:

  Millimeter | Search for all occurrences
  Point | Search for all occurrences
  Inch | Search for all occurrences
  Pica | Search for all occurrences
  Didot | Search for all occurrences
  Cicero | Search for all occurrences
  DevicePixel | Search for all occurrences

Definition at line 129 of file qprinter.h.

                  {
            Millimeter,
            Point,
            Inch,
            Pica,
            Didot,
            Cicero,
            DevicePixel
        };

enum DuplexMode

Search for all occurrences

Enumerator:

  DuplexNone | Search for all occurrences
  DuplexAuto | Search for all occurrences
  DuplexLongSide | Search for all occurrences
  DuplexShortSide | Search for all occurrences

Definition at line 139 of file qprinter.h.

                        {
            DuplexNone = 0,
            DuplexAuto,
            DuplexLongSide,
            DuplexShortSide
        };

## Constructor & Destructor Documentation

QPrinter | ( | PrinterMode | mode = `ScreenResolution` | ) | `[explicit]`

QPrinter | ( | const QPrinterInfo & | printer,
|  | PrinterMode | mode = `ScreenResolution`
| ) |  | `[explicit]`

~QPrinter | ( |  | ) |

## Member Function Documentation

int devType | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QPaintDevice.

void setOutputFormat | ( | OutputFormat | format | ) |

Search for all occurrences

OutputFormat outputFormat | ( |  | ) | const

Search for all occurrences

void setPrinterName | ( | const QString & |  | ) |

Search for all occurrences

QString printerName | ( |  | ) | const

Search for all occurrences

bool isValid | ( |  | ) | const

Search for all occurrences

void setOutputFileName | ( | const QString & |  | ) |

Search for all occurrences

QString outputFileName | ( |  | ) | const

Search for all occurrences

void setPrintProgram | ( | const QString & |  | ) |

Search for all occurrences

QString printProgram | ( |  | ) | const

Search for all occurrences

void setDocName | ( | const QString & |  | ) |

Search for all occurrences

QString docName | ( |  | ) | const

Search for all occurrences

void setCreator | ( | const QString & |  | ) |

Search for all occurrences

QString creator | ( |  | ) | const

Search for all occurrences

void setOrientation | ( | Orientation |  | ) |

Search for all occurrences

Orientation orientation | ( |  | ) | const

Search for all occurrences

void setPageSize | ( | PageSize |  | ) |

Search for all occurrences

PageSize pageSize | ( |  | ) | const

Search for all occurrences

void setPaperSize | ( | PaperSize |  | ) |

Search for all occurrences

PaperSize paperSize | ( |  | ) | const

Search for all occurrences

void setPaperSize | ( | const QSizeF & | paperSize,
|  | Unit | unit
| ) |  |

Search for all occurrences

QSizeF paperSize | ( | Unit | unit | ) | const

Search for all occurrences

void setPageOrder | ( | PageOrder |  | ) |

Search for all occurrences

PageOrder pageOrder | ( |  | ) | const

Search for all occurrences

void setResolution | ( | int |  | ) |

Search for all occurrences

int resolution | ( |  | ) | const

Search for all occurrences

void setColorMode | ( | ColorMode |  | ) |

Search for all occurrences

ColorMode colorMode | ( |  | ) | const

Search for all occurrences

void setCollateCopies | ( | bool | collate | ) |

Search for all occurrences

bool collateCopies | ( |  | ) | const

Search for all occurrences

void setFullPage | ( | bool |  | ) |

Search for all occurrences

bool fullPage | ( |  | ) | const

Search for all occurrences

void setNumCopies | ( | int |  | ) |

Search for all occurrences

int numCopies | ( |  | ) | const

Search for all occurrences

int actualNumCopies | ( |  | ) | const

Search for all occurrences

void setCopyCount | ( | int |  | ) |

Search for all occurrences

int copyCount | ( |  | ) | const

Search for all occurrences

bool supportsMultipleCopies | ( |  | ) | const

Search for all occurrences

void setPaperSource | ( | PaperSource |  | ) |

Search for all occurrences

PaperSource paperSource | ( |  | ) | const

Search for all occurrences

void setDuplex | ( | DuplexMode | duplex | ) |

Search for all occurrences

DuplexMode duplex | ( |  | ) | const

Search for all occurrences

QList<int> supportedResolutions | ( |  | ) | const

Search for all occurrences

void setFontEmbeddingEnabled | ( | bool | enable | ) |

Search for all occurrences

bool fontEmbeddingEnabled | ( |  | ) | const

Search for all occurrences

void setDoubleSidedPrinting | ( | bool | enable | ) |

Search for all occurrences

bool doubleSidedPrinting | ( |  | ) | const

Search for all occurrences

QRect paperRect | ( |  | ) | const

Search for all occurrences

QRect pageRect | ( |  | ) | const

Search for all occurrences

QRectF paperRect | ( | Unit |  | ) | const

Search for all occurrences

QRectF pageRect | ( | Unit |  | ) | const

Search for all occurrences

QString printerSelectionOption | ( |  | ) | const

Search for all occurrences

void setPrinterSelectionOption | ( | const QString & |  | ) |

Search for all occurrences

bool newPage | ( |  | ) |

Search for all occurrences

bool abort | ( |  | ) |

Search for all occurrences

PrinterState printerState | ( |  | ) | const

Search for all occurrences

QPaintEngine* paintEngine | ( |  | ) | const `[virtual]`

Search for all occurrences

Implements QPaintDevice.

QPrintEngine* printEngine | ( |  | ) | const

Search for all occurrences

void setFromTo | ( | int | fromPage,
|  | int | toPage
| ) |  |

Search for all occurrences

int fromPage | ( |  | ) | const

Search for all occurrences

int toPage | ( |  | ) | const

Search for all occurrences

void setPrintRange | ( | PrintRange | range | ) |

Search for all occurrences

PrintRange printRange | ( |  | ) | const

Search for all occurrences

void setPageMargins | ( | qreal | left,
|  | qreal | top,
|  | qreal | right,
|  | qreal | bottom,
|  | Unit | unit
| ) |  |

Search for all occurrences

void getPageMargins | ( | qreal * | left,
|  | qreal * | top,
|  | qreal * | right,
|  | qreal * | bottom,
|  | Unit | unit
| ) |  | const

Search for all occurrences

int metric | ( | PaintDeviceMetric |  | ) | const `[protected, virtual]`

Search for all occurrences

Reimplemented from QPaintDevice.

void setEngines | ( | QPrintEngine * | printEngine,
|  | QPaintEngine * | paintEngine
| ) |  | `[protected]`

Search for all occurrences

## Friends And Related Function Documentation

friend class QPrintDialogPrivate `[friend]`

Search for all occurrences

Definition at line 300 of file qprinter.h.

friend class QAbstractPrintDialog `[friend]`

Search for all occurrences

Definition at line 301 of file qprinter.h.

friend class QAbstractPrintDialogPrivate `[friend]`

Search for all occurrences

Definition at line 302 of file qprinter.h.

friend class QPrintPreviewWidgetPrivate `[friend]`

Search for all occurrences

Definition at line 303 of file qprinter.h.

friend class QTextDocument `[friend]`

Search for all occurrences

Definition at line 304 of file qprinter.h.

friend class QPageSetupWidget `[friend]`

Search for all occurrences

Definition at line 305 of file qprinter.h.

The documentation for this class was generated from the following file:

- QtGui/qprinter.h

QPrinter QPrinter QPrinter QPrinter QPrinter QPrinter QPrinter QPrinter QPrinter QPrinter
QPrinter QPrinter QPrinter QPrinter QPrinter QPrinter QPrinter QPrinter QPrinter QPrinter