CopperSpice API  1.9.2
QPrinterInfo Class Reference

The QPrinterInfo class gives access to information about existing printers. More...

Public Methods

 QPrinterInfo ()
 
 QPrinterInfo (const QPrinter &printer)
 
 QPrinterInfo (const QPrinterInfo &other)
 
 ~QPrinterInfo ()
 
QPrinter::DuplexMode defaultDuplexMode () const
 
QPageSize defaultPageSize () const
 
QString description () const
 
bool isDefault () const
 
bool isNull () const
 
bool isRemote () const
 
QString location () const
 
QString makeAndModel () const
 
QPageSize maximumPhysicalPageSize () const
 
QPageSize minimumPhysicalPageSize () const
 
QPrinterInfo & operator= (const QPrinterInfo &other)
 
QString printerName () const
 
QPrinter::PrinterState state () const
 
QList< QPrinter::DuplexModesupportedDuplexModes () const
 
QList< QPageSizesupportedPageSizes () const
 
QList< int > supportedResolutions () const
 
bool supportsCustomPageSizes () const
 

Static Public Methods

static QStringList availablePrinterNames ()
 
static QList< QPrinterInfo > availablePrinters ()
 
static QPrinterInfo defaultPrinter ()
 
static QString defaultPrinterName ()
 
static QPrinterInfo printerInfo (const QString &printerName)
 

Friends

class QPlatformPrinterSupport
 

Detailed Description

The QPrinterInfo class gives access to information about existing printers.

Use the static methods to generate a list of QPrinterInfo objects. Each QPrinterInfo object in the list represents a single printer and can be queried for name, supported paper sizes, and whether or not it is the default printer.

See also
isNull()

Constructor & Destructor Documentation

QPrinterInfo::QPrinterInfo ( )

Constructs an empty QPrinterInfo object.

See also
isNull()
QPrinterInfo::QPrinterInfo ( const QPrinterInfo &  other)

Constructs a new QPrinterInfo from other.

QPrinterInfo::QPrinterInfo ( const QPrinter printer)
explicit

Constructs a QPrinterInfo object from printer.

QPrinterInfo::~QPrinterInfo ( )

Destroys the QPrinterInfo object. References to the values in the object become invalid.

Method Documentation

QStringList QPrinterInfo::availablePrinterNames ( )
static

Returns a list of all the available Printer Names on this system. It is recommended to use this method instead of availablePrinters() as it will be faster on most systems.

The list may become outdated if changes are made on the local system or remote print server. Only instantiate required QPrinterInfo instances when needed, and always check for validity before calling.

QList< QPrinterInfo > QPrinterInfo::availablePrinters ( )
static

Returns a list of available printers on the system.

QPrinter::DuplexMode QPrinterInfo::defaultDuplexMode ( ) const

Returns the default duplex mode of this printer.

QPageSize QPrinterInfo::defaultPageSize ( ) const

Returns the current default QPageSize for this printer.

QPrinterInfo QPrinterInfo::defaultPrinter ( )
static

Returns the default printer on the system. The return value should be checked using isNull() before being used, in case there is no default printer.

QString QPrinterInfo::defaultPrinterName ( )
static

Returns the current default printer name.

QString QPrinterInfo::description ( ) const

Returns the readable description of the printer.

bool QPrinterInfo::isDefault ( ) const

Returns whether this printer is the default printer.

bool QPrinterInfo::isNull ( ) const

Returns whether this QPrinterInfo object holds a printer definition. An empty QPrinterInfo object could result for example from calling defaultPrinter() when there are no printers on the system.

bool QPrinterInfo::isRemote ( ) const

Returns whether this printer is a remote network printer.

QString QPrinterInfo::location ( ) const

Returns the readable location of the printer.

QString QPrinterInfo::makeAndModel ( ) const

Returns a readable make and model of the printer.

QPageSize QPrinterInfo::maximumPhysicalPageSize ( ) const

Returns the maximum physical page size supported by this printer.

QPageSize QPrinterInfo::minimumPhysicalPageSize ( ) const

Returns the minimum physical page size supported by this printer.

QPrinterInfo & QPrinterInfo::operator= ( const QPrinterInfo &  other)

Sets the QPrinterInfo object to be equal to other.

QPrinterInfo QPrinterInfo::printerInfo ( const QString printerName)
static

Returns the printerName. The return value should be checked using isNull() before being used, in case the named printer does not exist.

QString QPrinterInfo::printerName ( ) const

Returns the name of the printer.

See also
QPrinter::setPrinterName()
QPrinter::PrinterState QPrinterInfo::state ( ) const

Returns the current state of this printer. This state may not always be accurate, depending on the platform, printer driver, or printer itself.

QList< QPrinter::DuplexMode > QPrinterInfo::supportedDuplexModes ( ) const

Returns a list of duplex modes supported by this printer.

QList< QPageSize > QPrinterInfo::supportedPageSizes ( ) const

Returns a list of every QPageSize supported by this printer.

QList< int > QPrinterInfo::supportedResolutions ( ) const

Returns a list of resolutions supported by this printer.

bool QPrinterInfo::supportsCustomPageSizes ( ) const

Returns whether this printer supports custom page sizes.