|  | Home · All Classes · Modules

# QAbstractPrintDialog Class Reference
[QtGui module]

The QAbstractPrintDialog class provides a base implementation for print dialogs used to configure printers. More...

Inherits QDialog.

Inherited by QPrintDialog.

### Types

- enum PrintDialogOption { None, PrintToFile, PrintSelection, PrintPageRange, PrintCollateCopies }
- class PrintDialogOptions
- enum PrintRange { AllPages, Selection, PageRange }

### Methods

- __init__ (self, QPrinter printer, QWidget parent = None)
- addEnabledOption (self, PrintDialogOption option)
- PrintDialogOptions enabledOptions (self)
- int exec_ (self)
- int fromPage (self)
- bool isOptionEnabled (self, PrintDialogOption option)
- int maxPage (self)
- int minPage (self)
- QPrinter printer (self)
- PrintRange printRange (self)
- setEnabledOptions (self, PrintDialogOptions options)
- setFromTo (self, int fromPage, int toPage)
- setMinMax (self, int min, int max)
- setPrintRange (self, PrintRange range)
- int toPage (self)

## Detailed Description

The QAbstractPrintDialog class provides a base implementation for print dialogs used to configure printers.

This class implements getter and setter functions that are used to customize settings shown in print dialogs, but it is not used directly. Use QPrintDialog to display a print dialog in your application.

See also QPrintDialog, QPrinter, and Printing with Qt.

## Type Documentation

### QAbstractPrintDialog.PrintDialogOption

Used to specify which parts of the print dialog should be enabled.

Constant | Value | Description
--- | --- | ---
`QAbstractPrintDialog.None` | `0x0000` | None of the options are enabled.
`QAbstractPrintDialog.PrintToFile` | `0x0001` | The print to file option is enabled.
`QAbstractPrintDialog.PrintSelection` | `0x0002` | The print selection option is enalbed.
`QAbstractPrintDialog.PrintPageRange` | `0x0004` | The page range selection option is enabled.
`QAbstractPrintDialog.PrintCollateCopies` | `0x0010` |

The PrintDialogOptions type is a typedef for QFlags<PrintDialogOption>. It stores an OR combination of PrintDialogOption values.

### QAbstractPrintDialog.PrintRange

Used to specify the print range selection option.

Constant | Value | Description
--- | --- | ---
`QAbstractPrintDialog.AllPages` | `0` | All pages should be printed.
`QAbstractPrintDialog.Selection` | `1` | Only the selection should be printed.
`QAbstractPrintDialog.PageRange` | `2` | The specified page range should be printed.

See also QPrinter.PrintRange.

## Method Documentation

### QAbstractPrintDialog.__init__ (self, QPrinter printer, QWidget parent = None)

The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

Constructs an abstract print dialog for printer with parent as parent widget.

### QAbstractPrintDialog.addEnabledOption (self, PrintDialogOption option)

Adds the option option to the set of enabled options in this dialog.

Note that this function has no effect on Mac OS X. See the QPrintDialog documentation for more information.

### PrintDialogOptions QAbstractPrintDialog.enabledOptions (self)

Returns the set of enabled options in this dialog.

See also setEnabledOptions().

### int QAbstractPrintDialog.exec_ (self)

This method is abstract and should be reimplemented in any sub-class.

This virtual function is called to pop up the dialog. It must be reimplemented in subclasses.

### int QAbstractPrintDialog.fromPage (self)

Returns the first page to be printed

### bool QAbstractPrintDialog.isOptionEnabled (self, PrintDialogOption option)

Returns true if the specified option is enabled; otherwise returns false

### int QAbstractPrintDialog.maxPage (self)

Returns the maximum page in the page range.

### int QAbstractPrintDialog.minPage (self)

Returns the minimum page in the page range.

### QPrinter QAbstractPrintDialog.printer (self)

Returns the printer that this printer dialog operates on.

### PrintRange QAbstractPrintDialog.printRange (self)

Returns the print range.

See also setPrintRange().

### QAbstractPrintDialog.setEnabledOptions (self, PrintDialogOptions options)

Sets the set of options that should be enabled in the print dialog to options.

Note that this function has no effect on Mac OS X. See the QPrintDialog documentation for more information.

See also enabledOptions().

### QAbstractPrintDialog.setFromTo (self, int fromPage, int toPage)

Sets the range in the print dialog to be from from to to.

### QAbstractPrintDialog.setMinMax (self, int min, int max)

Sets the page range in this dialog to be from min to max. This also enables the PrintPageRange option.

### QAbstractPrintDialog.setPrintRange (self, PrintRange range)

Sets the print range option in to be range.

See also printRange().

### int QAbstractPrintDialog.toPage (self)

Returns the last page to be printed.