以下成员源于类 QPrinter are part of the Qt compatibility layer. We advise against using them in new code.
| enum | PrinterOption { PrintToFile, PrintSelection, PrintPageRange } |
| bool | aborted () |
| bool | collateCopiesEnabled () const |
| bool | isOptionEnabled (PrinterOption option ) const |
| void | margins (uint * top , uint * left , uint * bottom , uint * right ) const |
| QSize | margins () const |
| int | maxPage () const |
| int | minPage () const |
| bool | outputToFile () const |
| bool | pageSetup (QWidget * parent = 0) |
| bool | printSetup (QWidget * parent = 0) |
| void | setCollateCopiesEnabled (bool enable ) |
| void | setMinMax (int minPage , int maxPage ) |
| void | setOptionEnabled (PrinterOption option , bool enable ) |
| void | setOutputToFile (bool enable ) |
| bool | setup (QWidget * parent = 0) |
使用 QAbstractPrintDialog::PrintDialogOption 代替。
| 常量 | 值 |
|---|---|
QPrinter::PrintToFile
|
0
|
QPrinter::PrintSelection
|
1
|
QPrinter::PrintPageRange
|
2
|
使用 printerState () == QPrinter::Aborted 代替。
Returns true if the printer is set up to collate copies of printed documents; otherwise returns false.
Use QPrintDialog::isOptionEnabled( QPrintDialog::PrintCollateCopies ) 代替。
另请参阅 setCollateCopiesEnabled () 和 collateCopies ().
使用 QPrintDialog 代替。
Sets * top , * left , * bottom , * right to be the top, left, bottom, and right margins.
This function has been superseded by paperRect () 和 pageRect ()。使用 paperRect ().top() - pageRect ().top() for the top margin, paperRect (). left () - pageRect (). left () for the left margin, paperRect ().bottom() - pageRect ().bottom() for the bottom margin, and papaerRect(). right () - pageRect (). right () for the right margin.
例如,若有代码像
uint rightMargin; uint bottomMargin; printer->margins(0, 0, &bottomMargin, &rightMargin);
可以把它重写成
int rightMargin = printer->paperRect().right() - printer->pageRect().right(); int bottomMargin = printer->paperRect().bottom() - printer->pageRect().bottom();
这是重载函数。
返回 QSize containing the left margin and the top margin.
This function has been superseded by paperRect () 和 pageRect ()。使用 paperRect (). left () - pageRect (). left () for the left margin, and paperRect ().top() - pageRect ().top() for the top margin.
例如,若有代码像
QSize margins = printer->margins(); int leftMargin = margins.width(); int topMargin = margins.height();
可以把它重写成
int leftMargin = printer->paperRect().left() - printer->pageRect().left(); int topMargin = printer->paperRect().top() - printer->pageRect().top();
使用 QPrintDialog::maxPage () 代替。
使用 QPrintDialog::minPage () 代替。
Returns true if the output should be written to a file, or false if the output should be sent directly to the printer. The default setting is false.
另请参阅 setOutputToFile () 和 setOutputFileName ().
Executes a page setup dialog so that the user can configure the type of page used for printing. Returns true if the contents of the dialog are accepted; returns false if the dialog is canceled.
Executes a print setup dialog so that the user can configure the printing process. Returns true if the contents of the dialog are accepted; returns false if the dialog is canceled.
使用 QPrintDialog::setOption ( QPrintDialog::PrintCollateCopies ) 或 QPrintDialog::setOptions ( QPrintDialog::options () & ~ QPrintDialog::PrintCollateCopies ) instead, depending on enable .
另请参阅 collateCopiesEnabled ().
使用 QPrintDialog::setMinMax () 代替。
使用 QPrintDialog 代替。
另请参阅 isOptionEnabled ().
Specifies whether the output should be written to a file or sent directly to the printer.
Will output to a file if enable is true, or will output directly to the printer if enable 为 false。
另请参阅 outputToFile () 和 setOutputFileName ().
使用 QPrintDialog 代替。
例如,若有代码像
if (printer->setup(parent))
...
可以把它重写成
QPrintDialog dialog(printer, parent); if (dialog.exec()) ...