PySide6.QtPrintSupport.QPrintDialog¶
- class QPrintDialog¶
- The - QPrintDialogclass provides a dialog for specifying the printer’s configuration.- Details- Warning - This section contains snippets that were automatically translated from C++ to Python and may contain errors. - The dialog allows users to change document-related settings, such as the paper size and orientation, type of print (color or grayscale), range of pages, and number of copies to print. - Controls are also provided to enable users to choose from the printers available, including any configured network printers. - Typically, - QPrintDialogobjects are constructed with a- QPrinterobject, and executed using the- exec()function.- printDialog = QPrintDialog(printer, parent) if printDialog.exec() == QDialog.Accepted: # print ... - If the dialog is accepted by the user, the - QPrinterobject is correctly configured for printing.  - The printer dialog (shown above in Plastique style) enables access to common printing properties. On X11 platforms that use the CUPS printing system, the settings for each available printer can be modified via the dialog’s Properties push button. - On Windows and macOS, the native print dialog is used, which means that some QWidget and QDialog properties set on the dialog won’t be respected. The native print dialog on macOS does not support setting printer options, i.e. - setOptions()and- setOption()have no effect.- In Qt 4.4, it was possible to use the static functions to show a sheet on macOS. This is no longer supported in Qt 4.5. If you want this functionality, use - open().- See also - Synopsis¶- Properties¶- optionsᅟ- The various options that affect the look and feel of the dialog
 - Methods¶- def - __init__()
- def - exec_()
- def - open()
- def - options()
- def - setOption()
- def - setOptions()
- def - testOption()
 - Signals¶- def - accepted()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property optionsᅟ: Combination of QAbstractPrintDialog.PrintDialogOption¶
 - This property holds the various options that affect the look and feel of the dialog. - By default, all options are disabled. - Options should be set before showing the dialog. Setting them while the dialog is visible is not guaranteed to have an immediate effect on the dialog (depending on the option and on the platform). - See also - Access functions:
 - Constructs a print dialog with the given - parent.- Constructs a new modal printer dialog for the given - printerwith the given- parent.- This signal is emitted when the user accepts the values set in the print dialog. The - printerparameter includes the printer that the settings were applied to.- exec_()¶
- Return type:
- int 
 
 - Opens the dialog and connects its - accepted()signal to the slot specified by- receiverand- member.- The signal will be disconnected from the slot when the dialog is closed. - options()¶
- Return type:
- Combination of - PrintDialogOption
 - See also 
 - Getter of property - optionsᅟ.- setOption(option[, on=true])¶
- Parameters:
- option – - PrintDialogOption
- on – bool 
 
 
 - Sets the given - optionto be enabled if- onis true; otherwise, clears the given- option.- See also - setOptions(options)¶
- Parameters:
- options – Combination of - PrintDialogOption
 - See also 
 - Setter of property - optionsᅟ.- testOption(option)¶
- Parameters:
- option – - PrintDialogOption
- Return type:
- bool 
 
 - Returns - trueif the given- optionis enabled; otherwise, returns false.- See also