QPrinter Class Reference

#include <qprinter.h>

Class Description

Definition at line 66 of file qprinter.h.

+ Inheritance diagram for QPrinter:

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 Types inherited from QPaintDevice
enum  PaintDeviceMetric {
  PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM,
  PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY,
  PdmPhysicalDpiX, PdmPhysicalDpiY
}
 

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< intsupportedResolutions () 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
 
QPaintEnginepaintEngine () const
 
QPrintEngineprintEngine () 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
 
- Public Member Functions inherited from QPaintDevice
virtual ~QPaintDevice ()
 
bool paintingActive () const
 
int width () const
 
int height () const
 
int widthMM () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
int colorCount () const
 
int depth () const
 

Protected Member Functions

int metric (PaintDeviceMetric) const
 
void setEngines (QPrintEngine *printEngine, QPaintEngine *paintEngine)
 
- Protected Member Functions inherited from QPaintDevice
 QPaintDevice ()
 

Friends

class QPrintDialogPrivate
 
class QAbstractPrintDialog
 
class QAbstractPrintDialogPrivate
 
class QPrintPreviewWidgetPrivate
 
class QTextDocument
 
class QPageSetupWidget
 

Additional Inherited Members

- Protected Attributes inherited from QPaintDevice
ushort painters
 

Member Typedef Documentation

Definition at line 85 of file qprinter.h.

Member Enumeration Documentation

Enumerator
ScreenResolution 
PrinterResolution 
HighResolution 

Definition at line 70 of file qprinter.h.

Enumerator
Portrait 
Landscape 

Definition at line 78 of file qprinter.h.

enum PageSize
Enumerator
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 
NPaperSize 

Definition at line 81 of file qprinter.h.

81  { A4, B5, Letter, Legal, Executive,
82  A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1,
83  B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E,
enum PageOrder
Enumerator
FirstPageFirst 
LastPageFirst 

Definition at line 97 of file qprinter.h.

enum ColorMode
Enumerator
GrayScale 
Color 

Definition at line 100 of file qprinter.h.

Enumerator
OnlyOne 
Lower 
Middle 
Manual 
Envelope 
EnvelopeManual 
Auto 
Tractor 
SmallFormat 
LargeFormat 
LargeCapacity 
Cassette 
FormSource 
MaxPageSource 

Definition at line 103 of file qprinter.h.

Enumerator
Idle 
Active 
Aborted 
Error 

Definition at line 119 of file qprinter.h.

Enumerator
NativeFormat 
PdfFormat 
PostScriptFormat 

Definition at line 124 of file qprinter.h.

enum PrintRange
Enumerator
AllPages 
Selection 
PageRange 
CurrentPage 

Definition at line 127 of file qprinter.h.

enum Unit
Enumerator
Millimeter 
Point 
Inch 
Pica 
Didot 
Cicero 
DevicePixel 

Definition at line 129 of file qprinter.h.

enum DuplexMode
Enumerator
DuplexNone 
DuplexAuto 
DuplexLongSide 
DuplexShortSide 

Definition at line 139 of file qprinter.h.

Constructor & Destructor Documentation

QPrinter ( PrinterMode  mode = ScreenResolution)
explicit
QPrinter ( const QPrinterInfo printer,
PrinterMode  mode = ScreenResolution 
)
explicit
~QPrinter ( )

Member Function Documentation

int devType ( ) const
virtual

Reimplemented from QPaintDevice.

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
virtual

Implements QPaintDevice.

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
int metric ( PaintDeviceMetric  ) const
protectedvirtual

Reimplemented from QPaintDevice.

void setEngines ( QPrintEngine printEngine,
QPaintEngine paintEngine 
)
protected

Friends And Related Function Documentation

friend class QPrintDialogPrivate
friend

Definition at line 300 of file qprinter.h.

friend class QAbstractPrintDialog
friend

Definition at line 301 of file qprinter.h.

friend class QAbstractPrintDialogPrivate
friend

Definition at line 302 of file qprinter.h.

friend class QPrintPreviewWidgetPrivate
friend

Definition at line 303 of file qprinter.h.

friend class QTextDocument
friend

Definition at line 304 of file qprinter.h.

friend class QPageSetupWidget
friend

Definition at line 305 of file qprinter.h.


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