QAbstractPrintDialog 类为用于配置打印机的打印对话框提供基实现。 更多...
头: | #include <QAbstractPrintDialog> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS PrintSupport)
target_link_libraries(mytarget PRIVATE Qt6::PrintSupport) |
qmake: | QT += printsupport |
继承: | QDialog |
继承者: |
enum | PrintDialogOption { PrintToFile, PrintSelection, PrintPageRange, PrintShowPageSize, PrintCollateCopies, PrintCurrentPage } |
flags | PrintDialogOptions |
enum | PrintRange { AllPages, Selection, PageRange, CurrentPage } |
QAbstractPrintDialog (QPrinter * printer , QWidget * parent = nullptr) | |
int | fromPage () const |
int | maxPage () const |
int | minPage () const |
QAbstractPrintDialog::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 (QAbstractPrintDialog::PrintRange range ) |
int | toPage () const |
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.
另请参阅 QPrintDialog and QPrinter .
Used to specify which parts of the print dialog should be visible.
常量 | 值 | 描述 |
---|---|---|
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 |
The PrintDialogOptions type is a typedef for QFlags <PrintDialogOption>. It stores an OR combination of PrintDialogOption values.
用于指定打印范围选定选项。
常量 | 值 | 描述 |
---|---|---|
QAbstractPrintDialog::AllPages
|
0
|
应打印所有页面。 |
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. |
另请参阅 QPrinter::PrintRange .
[explicit]
QAbstractPrintDialog::
QAbstractPrintDialog
(
QPrinter
*
printer
,
QWidget
*
parent
= nullptr)
构造抽象打印对话框为 printer with parent 作为父级 Widget。
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.
返回打印范围。
另请参阅 setPrintRange ().
Returns the printer that this printer dialog operates on.
将打印对话框中的范围设为从 from to to .
Sets the page range in this dialog to be from min to max . This also enables the PrintPageRange 选项。
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.
Sets the print range option in to be range .
另请参阅 printRange ().
Returns the last page to be printed. By default, this value is set to 0.