Obsolete Members for QPrinter

以下成员源于类 QPrinter 已过时。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。

公共函数

(obsolete) int actualNumCopies () const
(obsolete) bool doubleSidedPrinting () const
(obsolete) void getPageMargins (qreal * left , qreal * top , qreal * right , qreal * bottom , Unit unit ) const
(obsolete) int numCopies () const
(obsolete) 取向 orientation () const
(obsolete) QRect pageRect () const
(obsolete) PageSize pageSize () const
(obsolete) QString paperName () const
(obsolete) QRect paperRect () const
(obsolete) PaperSize paperSize () const
(obsolete) QSizeF paperSize (Unit unit ) const
(obsolete) void setDoubleSidedPrinting (bool doubleSided )
(obsolete) virtual void setMargins (const Margins & m )
(obsolete) void setNumCopies (int numCopies )
(obsolete) void setOrientation (Orientation orientation )
(obsolete) void setPageMargins (qreal left , qreal top , qreal right , qreal bottom , Unit unit )
(obsolete) virtual void setPageSize (PageSize newPageSize )
(obsolete) virtual void setPageSizeMM (const QSizeF & size )
(obsolete) void setPaperName (const QString & paperName )
(obsolete) void setPaperSize (PaperSize newPaperSize )
(obsolete) void setPaperSize (const QSizeF & paperSize , 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 , 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.

On 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 ().

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 ().

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 ().

PaperSize QPrinter:: paperSize () const

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

该函数在 Qt 4.4 引入。

另请参阅 setPaperSize () 和 pageLayout ().

QSizeF QPrinter:: paperSize ( 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 is true; otherwise disables it.

该函数在 Qt 4.2 引入。

另请参阅 doubleSidedPrinting () 和 setDuplex ().

[virtual] void QPrinter:: setMargins (const 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 ( 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 , 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 ().

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

重实现自 QPagedPaintDevice::setPageSize ().

Sets the printer page size based on newPageSize .

另请参阅 setPageSize ().

[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 ( 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 , 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 ().