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

Methods


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 visible.

ConstantValueDescription
QAbstractPrintDialog.None0x0000None of the options are enabled.
QAbstractPrintDialog.PrintToFile0x0001The print to file option is enabled.
QAbstractPrintDialog.PrintSelection0x0002The print selection option is enabled.
QAbstractPrintDialog.PrintPageRange0x0004The page range selection option is enabled.
QAbstractPrintDialog.PrintCollateCopies0x0010 

This value is obsolete and does nothing since Qt 4.5:

ConstantValueDescription
QAbstractPrintDialog.DontUseSheet0x0020In previous versions of Qt, exec_() the print dialog would create a sheet by default the dialog was given a parent. This is no longer supported in Qt 4.5. If you want to use sheets, use QPrintDialog.open() instead.
QAbstractPrintDialog.PrintShowPageSize0x0008Show the page size + margins page only if this is enabled.

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.

ConstantValueDescription
QAbstractPrintDialog.AllPages0All pages should be printed.
QAbstractPrintDialog.Selection1Only the selection should be printed.
QAbstractPrintDialog.PageRange2The specified page range should be printed.

See also QPrinter.PrintRange.


Method Documentation

QAbstractPrintDialog.__init__ (self, QPrinter, 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)

PrintDialogOptions QAbstractPrintDialog.enabledOptions (self)

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 By default, this value is set to 0.

bool QAbstractPrintDialog.isOptionEnabled (self, PrintDialogOption)

int QAbstractPrintDialog.maxPage (self)

Returns the maximum page in the page range. As of Qt 4.4, this function returns INT_MAX by default. Previous versions returned 1 by default.

int QAbstractPrintDialog.minPage (self)

Returns the minimum page in the page range. By default, this value is set to 1.

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)

QAbstractPrintDialog.setFromTo (self, int, int)

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

QAbstractPrintDialog.setMinMax (self, int, int)

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

QAbstractPrintDialog.setOptionTabs (self, list-of-QWidget)

Set a list of widgets as tabs to be shown on the print dialog, if supported.

Currently this option is only supported on X11.

Setting the option tabs will transfer their ownership to the print dialog.

This function was introduced in Qt 4.4.

QAbstractPrintDialog.setPrintRange (self, PrintRange)

Sets the print range option in to be range.

See also printRange().

int QAbstractPrintDialog.toPage (self)

Returns the last page to be printed. By default, this value is set to 0.


PyQt 4.7.3 for X11Copyright © Riverbank Computing Ltd and Nokia 2010Qt 4.6.2