Obsolete Members for QPrinter

以下成員源於類 QPrinter 已過時。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。

公共函數

(obsolete) int actualNumCopies () const
(obsolete) bool doubleSidedPrinting () const
(obsolete) void getPageMargins (qreal * left , qreal * top , qreal * right , qreal * bottom , QPrinter::Unit unit ) const
(obsolete) int numCopies () const
(obsolete) QPrinter::Orientation orientation () const
(obsolete) QRect pageRect () const
(obsolete) QPagedPaintDevice::PageSize pageSize () const
(obsolete) QString paperName () const
(obsolete) QRect paperRect () const
(obsolete) QPrinter::PaperSize paperSize () const
(obsolete) QSizeF paperSize (QPrinter::Unit unit ) const
(obsolete) void setDoubleSidedPrinting (bool doubleSided )
(obsolete) void setNumCopies (int numCopies )
(obsolete) void setOrientation (QPrinter::Orientation orientation )
(obsolete) void setPageMargins (qreal left , qreal top , qreal right , qreal bottom , QPrinter::Unit unit )
(obsolete) void setPaperName (const QString & paperName )
(obsolete) void setPaperSize (QPrinter::PaperSize newPaperSize )
(obsolete) void setPaperSize (const QSizeF & paperSize , QPrinter::Unit unit )
(obsolete) void setWinPageSize (int pageSize )
(obsolete) int winPageSize () const

成員函數文檔編製

int QPrinter:: actualNumCopies () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the number of copies that will be printed. The default value is 1.

This function always returns the actual value specified in the print dialog or using setNumCopies ().

使用 copyCount () 代替。

該函數在 Qt 4.6 引入。

另請參閱 setNumCopies () 和 numCopies ().

bool QPrinter:: doubleSidedPrinting () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

返迴 true if double side printing is enabled.

該函數在 Qt 4.2 引入。

另請參閱 setDoubleSidedPrinting () 和 duplex ().

void QPrinter:: getPageMargins ( qreal * left , qreal * top , qreal * right , qreal * bottom , QPrinter::Unit unit ) const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the page margins for this printer in left , top , right , bottom . The unit of the returned margins are specified with the unit 參數。

該函數在 Qt 4.4 引入。

另請參閱 pageLayout () 和 setPageMargins ().

int QPrinter:: numCopies () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the number of copies to be printed. The default value is 1.

在 Windows, macOS and X11 systems that support CUPS, this will always return 1 as these operating systems can internally handle the number of copies.

On X11, this value will return the number of times the application is required to print in order to match the number specified in the printer setup dialog. This has been done since some printer drivers are not capable of buffering up the copies and in those cases the application must make an explicit call to the print code for each copy.

使用 copyCount () in conjunction with supportsMultipleCopies () 代替。

另請參閱 setNumCopies () 和 actualNumCopies ().

QPrinter::Orientation QPrinter:: orientation () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the orientation setting. This is driver-dependent, but is usually QPrinter::Portrait .

另請參閱 setOrientation () 和 pageLayout ().

QRect QPrinter:: pageRect () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the page's rectangle; this is usually smaller than the paperRect () since the page normally has margins between its borders and the paper.

The unit of the returned rectangle is DevicePixel .

另請參閱 pageLayout ().

QPagedPaintDevice::PageSize QPrinter:: pageSize () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the printer page size. The default value is driver-dependent.

另請參閱 setPageSize () 和 pageLayout ().

QString QPrinter:: paperName () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the paper name of the paper set on the printer.

The default value for this is driver-dependent.

該函數在 Qt 5.1 引入。

另請參閱 setPaperName () 和 pageLayout ().

QRect QPrinter:: paperRect () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the paper's rectangle; this is usually larger than the pageRect ().

The unit of the returned rectangle is DevicePixel .

另請參閱 pageLayout ().

QPrinter::PaperSize QPrinter:: paperSize () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the printer paper size. The default value is driver-dependent.

該函數在 Qt 4.4 引入。

另請參閱 setPaperSize () 和 pageLayout ().

QSizeF QPrinter:: paperSize ( QPrinter::Unit unit ) const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

pageLayout ().fullPageSize() instead.

Returns the paper size in unit .

Note that the returned size reflects the current paper orientation.

該函數在 Qt 4.4 引入。

另請參閱 pageLayout ().

void QPrinter:: setDoubleSidedPrinting ( bool doubleSided )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Enables double sided printing if doubleSided 為 true;否則禁用它。

該函數在 Qt 4.2 引入。

另請參閱 doubleSidedPrinting () 和 setDuplex ().

[override virtual] void QPrinter:: setMargins (const QPagedPaintDevice::Margins & m )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

重實現自 QPagedPaintDevice::setMargins ().

另請參閱 setPageMargins ().

void QPrinter:: setNumCopies ( int numCopies )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Sets the number of copies to be printed to numCopies .

The printer driver reads this setting and prints the specified number of copies.

使用 setCopyCount () 代替。

另請參閱 numCopies ().

void QPrinter:: setOrientation ( QPrinter::Orientation orientation )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Sets the print orientation to orientation .

The orientation can be either QPrinter::Portrait or QPrinter::Landscape .

The printer driver reads this setting and prints using the specified orientation.

On Windows and Mac, this option can be changed while printing and will take effect from the next call to newPage ().

另請參閱 orientation () 和 setPageOrientation ().

void QPrinter:: setPageMargins ( qreal left , qreal top , qreal right , qreal bottom , QPrinter::Unit unit )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

此函數設置 left , top , right and bottom page margins for this printer. The unit of the margins are specified with the unit 參數。

該函數在 Qt 4.4 引入。

另請參閱 setPageMargins ().

[override virtual] void QPrinter:: setPageSize ( QPagedPaintDevice::PageSize newPageSize )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

重實現自 QPagedPaintDevice::setPageSize ().

Sets the printer page size based on newPageSize .

另請參閱 setPageSize ().

[override virtual] void QPrinter:: setPageSizeMM (const QSizeF & size )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

重實現自 QPagedPaintDevice::setPageSizeMM ().

使用 setPageSize ( QPageSize ) 代替。

Note that the page size is defined in a portrait layout, regardless of what the current printer orientation is set to.

另請參閱 setPageSize ().

void QPrinter:: setPaperName (const QString & paperName )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Sets the paper used by the printer to paperName .

該函數在 Qt 5.1 引入。

另請參閱 paperName () 和 setPageSize ().

void QPrinter:: setPaperSize ( QPrinter::PaperSize newPaperSize )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Sets the printer paper size to newPaperSize if that size is supported. The result is undefined if newPaperSize 不支持。

The default paper size is driver-dependent.

This function is useful mostly for setting a default value that the user can override in the print dialog.

該函數在 Qt 4.4 引入。

另請參閱 paperSize () 和 setPageSize ().

void QPrinter:: setPaperSize (const QSizeF & paperSize , QPrinter::Unit unit )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Sets the paper size based on paperSize in unit .

Note that the paper size is defined in a portrait layout, regardless of what the current printer orientation is set to.

該函數在 Qt 4.4 引入。

另請參閱 setPageSize ().

void QPrinter:: setWinPageSize ( int pageSize )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Sets the page size to be used by the printer under Windows to pageSize .

另請參閱 winPageSize () 和 pageLayout ().

int QPrinter:: winPageSize () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the page size used by the printer under Windows.

另請參閱 setWinPageSize () 和 pageLayout ().