Qt 4.8
|
The QPrinterInfo class gives access to information about existing printers. More...
#include <qprinterinfo.h>
Public Functions | |
bool | isDefault () const |
Returns whether this printer is the default printer. More... | |
bool | isNull () const |
Returns whether this QPrinterInfo object holds a printer definition. More... | |
QPrinterInfo & | operator= (const QPrinterInfo &other) |
Sets the QPrinterInfo object to be equal to other. More... | |
QString | printerName () const |
Returns the name of the printer. More... | |
QPrinterInfo () | |
Constructs an empty QPrinterInfo object. More... | |
QPrinterInfo (const QPrinterInfo &other) | |
Constructs a copy of other. More... | |
QPrinterInfo (const QPrinter &printer) | |
Constructs a QPrinterInfo object from printer. More... | |
QList< QPrinter::PaperSize > | supportedPaperSizes () const |
Returns a list of supported paper sizes by the printer. More... | |
~QPrinterInfo () | |
Destroys the QPrinterInfo object. More... | |
Static Public Functions | |
static QList< QPrinterInfo > | availablePrinters () |
Returns a list of available printers on the system. More... | |
static QPrinterInfo | defaultPrinter () |
Returns the default printer on the system. More... | |
Private Functions | |
QPrinterInfo (const QString &name) | |
Properties | |
QScopedPointer< QPrinterInfoPrivate, QPrinterInfoPrivateDeleter > | d_ptr |
The QPrinterInfo class gives access to information about existing printers.
Use the static functions 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.
Definition at line 58 of file qprinterinfo.h.
QPrinterInfo::QPrinterInfo | ( | ) |
Constructs an empty QPrinterInfo object.
Definition at line 85 of file qprinterinfo.cpp.
QPrinterInfo::QPrinterInfo | ( | const QPrinterInfo & | other | ) |
Constructs a copy of other.
Definition at line 98 of file qprinterinfo.cpp.
QPrinterInfo::QPrinterInfo | ( | const QPrinter & | printer | ) |
Constructs a QPrinterInfo object from printer.
Definition at line 106 of file qprinterinfo.cpp.
QPrinterInfo::~QPrinterInfo | ( | ) |
Destroys the QPrinterInfo object.
References to the values in the object become invalid.
Definition at line 129 of file qprinterinfo.cpp.
|
private |
Definition at line 120 of file qprinterinfo.cpp.
|
static |
Returns a list of available printers on the system.
Definition at line 53 of file qprinterinfo_mac.cpp.
Referenced by defaultPrinter(), QPrinter::QPrinter(), QPrinterInfo(), qt_getLprPrinters(), and QPrinter::setPrinterName().
|
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.
Definition at line 74 of file qprinterinfo_mac.cpp.
Referenced by QPdfBaseEnginePrivate::closePrintDevice(), QPrinter::QPrinter(), and qt_getLprPrinters().
bool QPrinterInfo::isDefault | ( | ) | const |
Returns whether this printer is the default printer.
Definition at line 174 of file qprinterinfo.cpp.
Referenced by defaultPrinter(), and qt_getLprPrinters().
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.
Definition at line 165 of file qprinterinfo.cpp.
Referenced by QPdfBaseEnginePrivate::closePrintDevice(), QPrinter::QPrinter(), and supportedPaperSizes().
QPrinterInfo & QPrinterInfo::operator= | ( | const QPrinterInfo & | other | ) |
Sets the QPrinterInfo object to be equal to other.
Definition at line 141 of file qprinterinfo.cpp.
QString QPrinterInfo::printerName | ( | ) | const |
Returns the name of the printer.
Definition at line 153 of file qprinterinfo.cpp.
Referenced by availablePrinters(), QPdfBaseEnginePrivate::closePrintDevice(), QPrinter::QPrinter(), and QPrinterInfo().
QList< QPrinter::PaperSize > QPrinterInfo::supportedPaperSizes | ( | ) | const |
Returns a list of supported paper sizes by the printer.
Not all printer drivers support this query, so the list may be empty. On Mac OS X 10.3, this function always returns an empty list.
Definition at line 85 of file qprinterinfo_mac.cpp.
Referenced by qt_getLprPrinters().
|
private |
Definition at line 81 of file qprinterinfo.h.
Referenced by availablePrinters(), operator=(), QPrinterInfo(), and qt_getLprPrinters().