QPrinterInfo 类给予访问现有打印机的有关信息。 更多...
头: | #include <QPrinterInfo> |
qmake: | QT += printsupport |
Since: | Qt 4.4 |
该类在 Qt 4.4 引入。
QPrinterInfo (const QPrinter & printer ) | |
QPrinterInfo (const QPrinterInfo & other ) | |
QPrinterInfo () | |
QPrinterInfo & | operator= (const QPrinterInfo & other ) |
~QPrinterInfo () | |
QPrinter::ColorMode | defaultColorMode () const |
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::ColorMode> | supportedColorModes () const |
QList<QPrinter::DuplexMode> | supportedDuplexModes () const |
QList<QPageSize> | supportedPageSizes () const |
QList<int> | supportedResolutions () const |
bool | supportsCustomPageSizes () const |
QStringList | availablePrinterNames () |
QList<QPrinterInfo> | availablePrinters () |
QPrinterInfo | defaultPrinter () |
QString | defaultPrinterName () |
QPrinterInfo | printerInfo (const QString & printerName ) |
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.
Constructs a QPrinterInfo object from printer .
构造副本为 other .
Constructs an empty QPrinterInfo object.
另请参阅 isNull ().
设置 QPrinterInfo 对象等于 other .
销毁 QPrinterInfo object. References to the values in the object become invalid.
[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.
Returns the default color mode of this printer.
该函数在 Qt 5.13 引入。
Returns the default duplex mode of this printer.
该函数在 Qt 5.4 引入。
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 引入。
Returns the human-readable description of the printer.
该函数在 Qt 5.0 引入。
另请参阅 QPrinterInfo::printerName ().
Returns whether this printer is currently the default printer.
Returns whether this QPrinterInfo object holds a printer definition.
空 QPrinterInfo object could result for example from calling defaultPrinter () when there are no printers on the system.
Returns whether this printer is a remote network printer.
该函数在 Qt 5.3 引入。
Returns the human-readable location of the printer.
该函数在 Qt 5.0 引入。
Returns the human-readable make and model of the printer.
该函数在 Qt 5.0 引入。
Returns the maximum physical page size supported by this printer.
该函数在 Qt 5.3 引入。
另请参阅 minimumPhysicalPageSize ().
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 ().
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 ().
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 引入。
Returns the supported color modes of this printer.
该函数在 Qt 5.13 引入。
Returns a list of duplex modes supported by this printer.
该函数在 Qt 5.4 引入。
Returns a list of Page Sizes supported by this printer.
该函数在 Qt 5.3 引入。
Returns a list of resolutions supported by this printer.
该函数在 Qt 5.3 引入。
Returns whether this printer supports custom page sizes.
该函数在 Qt 5.3 引入。