QPrinterInfo¶
The
QPrinterInfo
class gives access to information about existing printers. More…
Synopsis¶
Functions¶
def
defaultColorMode
()def
defaultDuplexMode
()def
defaultPageSize
()def
description
()def
isDefault
()def
isNull
()def
isRemote
()def
location
()def
makeAndModel
()def
maximumPhysicalPageSize
()def
minimumPhysicalPageSize
()def
printerName
()def
state
()def
supportedColorModes
()def
supportedDuplexModes
()def
supportedPageSizes
()def
supportedPaperSizes
()def
supportedResolutions
()def
supportedSizesWithNames
()def
supportsCustomPageSizes
()
Static functions¶
def
availablePrinterNames
()def
availablePrinters
()def
defaultPrinter
()def
defaultPrinterName
()def
printerInfo
(printerName)
Detailed Description¶
Use the static functions to generate a list of
QPrinterInfo
objects. EachQPrinterInfo
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.
- class PySide2.QtPrintSupport.QPrinterInfo¶
PySide2.QtPrintSupport.QPrinterInfo(printer)
PySide2.QtPrintSupport.QPrinterInfo(other)
- param other:
- param printer:
Constructs an empty
QPrinterInfo
object.See also
- static PySide2.QtPrintSupport.QPrinterInfo.availablePrinterNames()¶
- Return type:
list of strings
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.
- static PySide2.QtPrintSupport.QPrinterInfo.availablePrinters()¶
- Return type:
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.
- PySide2.QtPrintSupport.QPrinterInfo.defaultColorMode()¶
- Return type:
Returns the default color mode of this printer.
- PySide2.QtPrintSupport.QPrinterInfo.defaultDuplexMode()¶
- Return type:
Returns the default duplex mode of this printer.
- PySide2.QtPrintSupport.QPrinterInfo.defaultPageSize()¶
- Return type:
Returns the current default Page Size for this printer.
- static PySide2.QtPrintSupport.QPrinterInfo.defaultPrinter()¶
- Return type:
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.
See also
- static PySide2.QtPrintSupport.QPrinterInfo.defaultPrinterName()¶
- Return type:
str
Returns the current default printer name.
- PySide2.QtPrintSupport.QPrinterInfo.description()¶
- Return type:
str
Returns the human-readable description of the printer.
See also
- PySide2.QtPrintSupport.QPrinterInfo.isDefault()¶
- Return type:
bool
Returns whether this printer is currently the default printer.
- PySide2.QtPrintSupport.QPrinterInfo.isNull()¶
- Return type:
bool
Returns whether this
QPrinterInfo
object holds a printer definition.An empty
QPrinterInfo
object could result for example from callingdefaultPrinter()
when there are no printers on the system.
- PySide2.QtPrintSupport.QPrinterInfo.isRemote()¶
- Return type:
bool
Returns whether this printer is a remote network printer.
- PySide2.QtPrintSupport.QPrinterInfo.location()¶
- Return type:
str
Returns the human-readable location of the printer.
- PySide2.QtPrintSupport.QPrinterInfo.makeAndModel()¶
- Return type:
str
Returns the human-readable make and model of the printer.
- PySide2.QtPrintSupport.QPrinterInfo.maximumPhysicalPageSize()¶
- Return type:
Returns the maximum physical page size supported by this printer.
See also
- PySide2.QtPrintSupport.QPrinterInfo.minimumPhysicalPageSize()¶
- Return type:
Returns the minimum physical page size supported by this printer.
See also
- static PySide2.QtPrintSupport.QPrinterInfo.printerInfo(printerName)¶
- Parameters:
printerName – str
- Return type:
Returns the printer
printerName
.The return value should be checked using
isNull()
before being used, in case the named printer does not exist.See also
- PySide2.QtPrintSupport.QPrinterInfo.printerName()¶
- Return type:
str
Returns the name of the printer.
This is a unique id to identify the printer and may not be human-readable.
See also
- PySide2.QtPrintSupport.QPrinterInfo.state()¶
- Return type:
Returns the current state of this printer.
This state may not always be accurate, depending on the platform, printer driver, or printer itself.
- PySide2.QtPrintSupport.QPrinterInfo.supportedColorModes()¶
- Return type:
Returns the supported color modes of this printer.
- PySide2.QtPrintSupport.QPrinterInfo.supportedDuplexModes()¶
- Return type:
Returns a list of duplex modes supported by this printer.
- PySide2.QtPrintSupport.QPrinterInfo.supportedPageSizes()¶
- Return type:
Returns a list of Page Sizes supported by this printer.
- PySide2.QtPrintSupport.QPrinterInfo.supportedPaperSizes()¶
- Return type:
Note
This function is deprecated.
Use
supportedPageSizes()
instead.Returns a list of supported paper sizes by the printer.
Not all printer drivers support this query, so the list may be empty.
- PySide2.QtPrintSupport.QPrinterInfo.supportedResolutions()¶
- Return type:
Returns a list of resolutions supported by this printer.
- PySide2.QtPrintSupport.QPrinterInfo.supportedSizesWithNames()¶
- Return type:
Note
This function is deprecated.
Use
supportedPageSizes()
instead.Returns a list of all the paper names supported by the driver with the corresponding size in millimeters.
Not all printer drivers support this query, so the list may be empty.
- PySide2.QtPrintSupport.QPrinterInfo.supportsCustomPageSizes()¶
- Return type:
bool
Returns whether this printer supports custom page sizes.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.