QPagedPaintDevice 类

QPagedPaintDevice 类是支持多个页面的描绘设备的表示。 更多...

头: #include <QPagedPaintDevice>
qmake: QT += gui
继承: QPaintDevice
继承者:

QPdfWriter and QPrinter

公共类型

class Margins
enum PageSize { A0, A1, A2, A3, ..., LastPageSize }

公共函数

QPagedPaintDevice ()
~QPagedPaintDevice ()
Margins margins () const
virtual bool newPage () = 0
QPageLayout pageLayout () const
PageSize pageSize () const
QSizeF pageSizeMM () const
virtual void setMargins (const Margins & margins )
bool setPageLayout (const QPageLayout & newPageLayout )
bool setPageMargins (const QMarginsF & margins )
bool setPageMargins (const QMarginsF & margins , QPageLayout::Unit units )
bool setPageOrientation (QPageLayout::Orientation orientation )
bool setPageSize (const QPageSize & pageSize )
virtual void setPageSize (PageSize size )
virtual void setPageSizeMM (const QSizeF & size )

额外继承成员

详细描述

QPagedPaintDevice 类是支持多个页面的描绘设备的表示。

分页描绘设备用于为打印或像 PDF 的格式生成输出。 QPdfWriter and QPrinter 继承自它。

成员类型文档编制

enum QPagedPaintDevice:: PageSize

This enum type lists the available page sizes as defined in the Postscript PPD standard. These values are duplicated in QPageSize and QPrinter .

定义尺寸:

常量 描述
QPagedPaintDevice::A0 5 841 x 1189 mm
QPagedPaintDevice::A1 6 594 x 841 mm
QPagedPaintDevice::A2 7 420 x 594 mm
QPagedPaintDevice::A3 8 297 x 420 mm
QPagedPaintDevice::A4 0 210 x 297 mm, 8.26 x 11.69 inches
QPagedPaintDevice::A5 9 148 x 210 mm
QPagedPaintDevice::A6 10 105 x 148 mm
QPagedPaintDevice::A7 11 74 x 105 mm
QPagedPaintDevice::A8 12 52 x 74 mm
QPagedPaintDevice::A9 13 37 x 52 mm
QPagedPaintDevice::B0 14 1000 x 1414 mm
QPagedPaintDevice::B1 15 707 x 1000 mm
QPagedPaintDevice::B2 17 500 x 707 mm
QPagedPaintDevice::B3 18 353 x 500 mm
QPagedPaintDevice::B4 19 250 x 353 mm
QPagedPaintDevice::B5 1 176 x 250 mm, 6.93 x 9.84 inches
QPagedPaintDevice::B6 20 125 x 176 mm
QPagedPaintDevice::B7 21 88 x 125 mm
QPagedPaintDevice::B8 22 62 x 88 mm
QPagedPaintDevice::B9 23 33 x 62 mm
QPagedPaintDevice::B10 16 31 x 44 mm
QPagedPaintDevice::C5E 24 163 x 229 mm
QPagedPaintDevice::Comm10E 25 105 x 241 mm, U.S. Common 10 Envelope
QPagedPaintDevice::DLE 26 110 x 220 mm
QPagedPaintDevice::Executive 4 7.5 x 10 inches, 190.5 x 254 mm
QPagedPaintDevice::Folio 27 210 x 330 mm
QPagedPaintDevice::Ledger 28 431.8 x 279.4 mm
QPagedPaintDevice::Legal 3 8.5 x 14 inches, 215.9 x 355.6 mm
QPagedPaintDevice::Letter 2 8.5 x 11 inches, 215.9 x 279.4 mm
QPagedPaintDevice::Tabloid 29 279.4 x 431.8 mm
QPagedPaintDevice::Custom 30 Unknown, or a user defined size.
QPagedPaintDevice::A10 31
QPagedPaintDevice::A3Extra 32
QPagedPaintDevice::A4Extra 33
QPagedPaintDevice::A4Plus 34
QPagedPaintDevice::A4Small 35
QPagedPaintDevice::A5Extra 36
QPagedPaintDevice::B5Extra 37
QPagedPaintDevice::JisB0 38
QPagedPaintDevice::JisB1 39
QPagedPaintDevice::JisB2 40
QPagedPaintDevice::JisB3 41
QPagedPaintDevice::JisB4 42
QPagedPaintDevice::JisB5 43
QPagedPaintDevice::JisB6 44 ,
QPagedPaintDevice::JisB7 45
QPagedPaintDevice::JisB8 46
QPagedPaintDevice::JisB9 47
QPagedPaintDevice::JisB10 48
QPagedPaintDevice::AnsiA Letter = Letter
QPagedPaintDevice::AnsiB Ledger = Ledger
QPagedPaintDevice::AnsiC 49
QPagedPaintDevice::AnsiD 50
QPagedPaintDevice::AnsiE 51
QPagedPaintDevice::LegalExtra 52
QPagedPaintDevice::LetterExtra 53
QPagedPaintDevice::LetterPlus 54
QPagedPaintDevice::LetterSmall 55
QPagedPaintDevice::TabloidExtra 56
QPagedPaintDevice::ArchA 57
QPagedPaintDevice::ArchB 58
QPagedPaintDevice::ArchC 59
QPagedPaintDevice::ArchD 60
QPagedPaintDevice::ArchE 61
QPagedPaintDevice::Imperial7x9 62
QPagedPaintDevice::Imperial8x10 63
QPagedPaintDevice::Imperial9x11 64
QPagedPaintDevice::Imperial9x12 65
QPagedPaintDevice::Imperial10x11 66
QPagedPaintDevice::Imperial10x13 67
QPagedPaintDevice::Imperial10x14 68
QPagedPaintDevice::Imperial12x11 69
QPagedPaintDevice::Imperial15x11 70
QPagedPaintDevice::ExecutiveStandard 71
QPagedPaintDevice::Note 72
QPagedPaintDevice::Quarto 73
QPagedPaintDevice::Statement 74
QPagedPaintDevice::SuperA 75
QPagedPaintDevice::SuperB 76
QPagedPaintDevice::Postcard 77
QPagedPaintDevice::DoublePostcard 78
QPagedPaintDevice::Prc16K 79
QPagedPaintDevice::Prc32K 80
QPagedPaintDevice::Prc32KBig 81
QPagedPaintDevice::FanFoldUS 82
QPagedPaintDevice::FanFoldGerman 83
QPagedPaintDevice::FanFoldGermanLegal 84
QPagedPaintDevice::EnvelopeB4 85
QPagedPaintDevice::EnvelopeB5 86
QPagedPaintDevice::EnvelopeB6 87
QPagedPaintDevice::EnvelopeC0 88
QPagedPaintDevice::EnvelopeC1 89
QPagedPaintDevice::EnvelopeC2 90
QPagedPaintDevice::EnvelopeC3 91
QPagedPaintDevice::EnvelopeC4 92
QPagedPaintDevice::EnvelopeC5 C5E = C5E
QPagedPaintDevice::EnvelopeC6 93
QPagedPaintDevice::EnvelopeC65 94
QPagedPaintDevice::EnvelopeC7 95
QPagedPaintDevice::EnvelopeDL DLE = DLE
QPagedPaintDevice::Envelope9 96
QPagedPaintDevice::Envelope10 Comm10E = Comm10E
QPagedPaintDevice::Envelope11 97
QPagedPaintDevice::Envelope12 98
QPagedPaintDevice::Envelope14 99
QPagedPaintDevice::EnvelopeMonarch 100
QPagedPaintDevice::EnvelopePersonal 101
QPagedPaintDevice::EnvelopeChou3 102
QPagedPaintDevice::EnvelopeChou4 103
QPagedPaintDevice::EnvelopeInvite 104
QPagedPaintDevice::EnvelopeItalian 105
QPagedPaintDevice::EnvelopeKaku2 106
QPagedPaintDevice::EnvelopeKaku3 107
QPagedPaintDevice::EnvelopePrc1 108
QPagedPaintDevice::EnvelopePrc2 109
QPagedPaintDevice::EnvelopePrc3 110
QPagedPaintDevice::EnvelopePrc4 111
QPagedPaintDevice::EnvelopePrc5 112
QPagedPaintDevice::EnvelopePrc6 113
QPagedPaintDevice::EnvelopePrc7 114
QPagedPaintDevice::EnvelopePrc8 115
QPagedPaintDevice::EnvelopePrc9 116
QPagedPaintDevice::EnvelopePrc10 117
QPagedPaintDevice::EnvelopeYou4 118
QPagedPaintDevice::LastPageSize EnvelopeYou4 = EnvelopeYou4

Due to historic reasons QPageSize::Executive is not the same as the standard Postscript and Windows Executive size, use QPageSize::ExecutiveStandard 代替。

The Postscript standard size QPageSize::Folio is different to the Windows DMPAPER_FOLIO size, use the Postscript standard size QPageSize::FanFoldGermanLegal if needed.

成员函数文档编制

QPagedPaintDevice:: QPagedPaintDevice ()

构造新的分页描绘设备。

QPagedPaintDevice:: ~QPagedPaintDevice ()

销毁对象。

Margins QPagedPaintDevice:: margins () const

Returns the current margins of the paint device. The default is 0.

边距以毫米为单位指定。

另请参阅 setMargins ().

[pure virtual] bool QPagedPaintDevice:: newPage ()

开始新页面。返回 true 当成功时。

QPageLayout QPagedPaintDevice:: pageLayout () const

返回当前页面的布局。使用此方法以访问当前 QPageSize , QPageLayout::Orientation , QMarginsF ,fullRect() 和 paintRect()。

注意:不可以在返回对象上使用 Setter,必须单独调用 QPagedPaintDevice Setter 或使用 setPageLayout ().

该函数在 Qt 5.3 引入。

另请参阅 setPageLayout (), setPageSize (), setPageOrientation (),和 setPageMargins ().

PageSize QPagedPaintDevice:: pageSize () const

Returns the currently used page size.

另请参阅 setPageSize ().

QSizeF QPagedPaintDevice:: pageSizeMM () const

返回页面尺寸 (以毫米为单位)。

另请参阅 setPageSizeMM ().

[virtual] void QPagedPaintDevice:: setMargins (const Margins & margins )

Sets the margins to be used to margins .

边距以毫米为单位指定。

The margins are purely a hint to the drawing method. They don't affect the coordinate system or clipping.

另请参阅 margins ().

bool QPagedPaintDevice:: setPageLayout (const QPageLayout & newPageLayout )

将页面布局设为 newPageLayout .

应先调用这当调用 QPainter::begin (),或立即调用在调用 newPage () 以将新页面布局应用到新页面之前。不应调用任何描绘方法,在调用 setPageLayout() 和 newPage () 之间因为可能使用了错误的描绘规格。

返回 true 若页面布局被成功设为 newPageLayout .

该函数在 Qt 5.3 引入。

另请参阅 pageLayout ().

bool QPagedPaintDevice:: setPageMargins (const QMarginsF & margins )

Set the page margins 在当前页面布局单位。

应先调用这当调用 QPainter::begin (),或立即调用在调用 newPage () 以将新边距应用到新页面之前。不应调用任何描绘方法,在调用 setPageMargins() 和 newPage () 之间因为可能使用了错误的描绘规格。

要获取当前页面边距,使用 pageLayout ().pageMargins().

返回 true 若页面边距被成功设为 margins .

该函数在 Qt 5.3 引入。

另请参阅 pageLayout ().

bool QPagedPaintDevice:: setPageMargins (const QMarginsF & margins , QPageLayout::Unit units )

Set the page margins 定义以给定 units .

应先调用这当调用 QPainter::begin (),或立即调用在调用 newPage () 以将新边距应用到新页面之前。不应调用任何描绘方法,在调用 setPageMargins () 和 newPage () 之间因为可能使用了错误的描绘规格。

要获取当前页面边距,使用 pageLayout ().pageMargins().

返回 true 若页面边距被成功设为 margins .

该函数在 Qt 5.3 引入。

另请参阅 pageLayout ().

bool QPagedPaintDevice:: setPageOrientation ( QPageLayout::Orientation orientation )

设置页面 orientation .

页面取向用于定义页面大小的取向,当获取页面矩形时。

应先调用这当调用 QPainter::begin (),或立即调用在调用 newPage () 以将新取向应用到新页面之前。不应调用任何描绘方法,在调用 setPageOrientation() 和 newPage () 之间因为可能使用了错误的描绘规格。

要获取当前 QPageLayout::Orientation use pageLayout ().pageOrientation().

返回 true 若页面取向被成功设为 orientation .

该函数在 Qt 5.3 引入。

另请参阅 pageLayout ().

bool QPagedPaintDevice:: setPageSize (const QPageSize & pageSize )

将页面大小设为 pageSize .

要获取当前 QPageSize use pageLayout (). pageSize ().

应先调用这当调用 QPainter::begin (),或立即调用在调用 newPage () 以将新页面尺寸应用到新页面之前。不应调用任何描绘方法,在调用 setPageSize() 和 newPage () 之间因为可能使用了错误的描绘规格。

返回 true 若页面大小被成功设为 pageSize .

该函数在 Qt 5.3 引入。

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

[virtual] void QPagedPaintDevice:: setPageSize ( PageSize size )

Sets the size of the a page to size .

另请参阅 setPageSizeMM ().

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

将页面大小设为 size . size is specified in millimeters.

If the size matches a standard QPagedPaintDevice::PageSize then that page size will be used, otherwise QPagedPaintDevice::Custom will be set.

另请参阅 pageSizeMM ().