QPrinterInfo 類

The QPrinterInfo class gives access to information about existing printers. 更多...

頭: #include <QPrinterInfo>
qmake: QT += printsupport
Since: Qt 4.4

公共函數

QPrinterInfo ()
QPrinterInfo (const QPrinterInfo & other )
QPrinterInfo (const QPrinter & printer )
~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
QString printerName () const
QPrinter::PrinterState state () const
QList<QPrinter::DuplexMode> supportedDuplexModes () const
QList<QPageSize> supportedPageSizes () const
QList<int> supportedResolutions () const
bool supportsCustomPageSizes () const
QPrinterInfo & operator= (const QPrinterInfo & other )

靜態公共成員

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

詳細描述

The QPrinterInfo class gives access to information about existing printers.

使用靜態函數以生成列錶為 QPrinterInfo 對象。每個 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.

成員函數文檔編製

QPrinterInfo:: QPrinterInfo ()

構造空的 QPrinterInfo 對象。

另請參閱 isNull ().

QPrinterInfo:: QPrinterInfo (const QPrinterInfo & other )

構造副本為 other .

QPrinterInfo:: QPrinterInfo (const QPrinter & printer )

構造 QPrinterInfo 對象從 printer .

QPrinterInfo:: ~QPrinterInfo ()

銷毀 QPrinterInfo 對象。引用對象中的值變為無效。

[static] QStringList QPrinterInfo:: availablePrinterNames ()

Returns a list of all the available Printer Names on this system.

It is recommended to use this instead of availablePrinters () as it will be faster on most systems.

Note that 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.

該函數在 Qt 5.3 引入。

[static] QList < QPrinterInfo > QPrinterInfo:: availablePrinters ()

Returns a list of QPrinterInfo objects for all the available printers on this system.

It is NOT recommended to use this as creating each printer instance may take a long time, especially if there are remote networked printers, and retained instances may become outdated if changes are made on the local system or remote print server. Use availablePrinterNames () instead and only instantiate printer instances as you need them.

QPrinter::DuplexMode QPrinterInfo:: defaultDuplexMode () const

Returns the default duplex mode of this printer.

該函數在 Qt 5.4 引入。

QPageSize QPrinterInfo:: defaultPageSize () const

Returns the current default Page Size for this printer.

該函數在 Qt 5.3 引入。

[static] QPrinterInfo QPrinterInfo:: defaultPrinter ()

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.

On some systems it is possible for there to be available printers but none of them set to be the default printer.

另請參閱 isNull (), isDefault (),和 availablePrinters ().

[static] QString QPrinterInfo:: defaultPrinterName ()

Returns the current default printer name.

該函數在 Qt 5.3 引入。

QString QPrinterInfo:: description () const

Returns the human-readable description of the printer.

該函數在 Qt 5.0 引入。

另請參閱 QPrinterInfo::printerName ().

bool QPrinterInfo:: isDefault () const

Returns whether this printer is currently the default printer.

bool QPrinterInfo:: isNull () const

返迴是否此 QPrinterInfo object holds a printer definition.

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.

該函數在 Qt 5.3 引入。

QString QPrinterInfo:: location () const

Returns the human-readable location of the printer.

該函數在 Qt 5.0 引入。

QString QPrinterInfo:: makeAndModel () const

Returns the human-readable make and model of the printer.

該函數在 Qt 5.0 引入。

QPageSize QPrinterInfo:: maximumPhysicalPageSize () const

Returns the maximum physical page size supported by this printer.

該函數在 Qt 5.3 引入。

另請參閱 minimumPhysicalPageSize ().

QPageSize QPrinterInfo:: minimumPhysicalPageSize () const

Returns the minimum physical page size supported by this printer.

該函數在 Qt 5.3 引入。

另請參閱 maximumPhysicalPageSize ().

[static] QPrinterInfo QPrinterInfo:: printerInfo (const QString & printerName )

Returns the printer printerName .

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

該函數在 Qt 5.0 引入。

另請參閱 isNull ().

QString QPrinterInfo:: printerName () const

Returns the name of the printer.

This is a unique id to identify the printer and may not be human-readable.

另請參閱 QPrinterInfo::description () 和 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.

該函數在 Qt 5.3 引入。

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

Returns a list of duplex modes supported by this printer.

該函數在 Qt 5.4 引入。

QList < QPageSize > QPrinterInfo:: supportedPageSizes () const

Returns a list of Page Sizes supported by this printer.

該函數在 Qt 5.3 引入。

QList < int > QPrinterInfo:: supportedResolutions () const

Returns a list of resolutions supported by this printer.

該函數在 Qt 5.3 引入。

bool QPrinterInfo:: supportsCustomPageSizes () const

Returns whether this printer supports custom page sizes.

該函數在 Qt 5.3 引入。

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

設置 QPrinterInfo 對象等於 other .