
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQAbstractPrintDialog class provides a base implementation for print dialogs used to configure printers.More...
| Header: | #include <QAbstractPrintDialog> |
| Inherits: | QDialog |
| Inherited By: |
| enum | PrintDialogOption { None, PrintToFile, PrintSelection, PrintPageRange, ..., DontUseSheet } |
| flags | PrintDialogOptions |
| enum | PrintRange { AllPages, Selection, PageRange, CurrentPage } |
| QAbstractPrintDialog(QPrinter * printer, QWidget * parent = 0) | |
| virtual int | exec() = 0 |
| int | fromPage() const |
| int | maxPage() const |
| int | minPage() const |
| PrintRange | printRange() const |
| QPrinter * | printer() const |
| void | setFromTo(int from, int to) |
| void | setMinMax(int min, int max) |
| void | setOptionTabs(const QList<QWidget *> & tabs) |
| void | setPrintRange(PrintRange range) |
| int | toPage() const |
TheQAbstractPrintDialog 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. UseQPrintDialog to display a print dialog in your application.
In Symbian, there is no support for printing. Hence, this dialog should not be used in Symbian.
See alsoQPrintDialog,QPrinter, andPrinting with Qt.
Used to specify which parts of the print dialog should be visible.
| 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 enabled. |
QAbstractPrintDialog::PrintPageRange | 0x0004 | The page range selection option is enabled. |
QAbstractPrintDialog::PrintShowPageSize | 0x0008 | Show the page size + margins page only if this is enabled. |
QAbstractPrintDialog::PrintCollateCopies | 0x0010 | The collate copies option is enabled |
QAbstractPrintDialog::PrintCurrentPage | 0x0040 | The print current page option is enabled (This value was introduced in 4.7.) |
This value is obsolete and does nothing since Qt 4.5:
| Constant | Value | Description |
|---|---|---|
QAbstractPrintDialog::DontUseSheet | 0x0020 | In 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, useQPrintDialog::open() instead. |
The PrintDialogOptions type is a typedef forQFlags<PrintDialogOption>. It stores an OR combination of PrintDialogOption values.
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. |
QAbstractPrintDialog::CurrentPage | 3 | Only the currently visible page should be printed. (This value was introduced in 4.7.) |
See alsoQPrinter::PrintRange.
Constructs an abstract print dialog forprinter withparent as parent widget.
[pure virtual]int QAbstractPrintDialog::exec()This virtual function is called to pop up the dialog. It must be reimplemented in subclasses.
Returns the first page to be printed By default, this value is set to 0.
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.
Returns the minimum page in the page range. By default, this value is set to 1.
Returns the print range.
See alsosetPrintRange().
Returns the printer that this printer dialog operates on.
Sets the range in the print dialog to be fromfrom toto.
Sets the page range in this dialog to be frommin tomax. This also enables thePrintPageRange option.
Set a list of widgets astabs 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.
Sets the print range option in to berange.
See alsoprintRange().
Returns the last page to be printed. By default, this value is set to 0.
© 2016 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 theGNU 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.