QPagedPaintDevice 類

The 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 )

額外繼承成員

詳細描述

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

[虛擬] 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 使用 pageLayout ().pageOrientation().

返迴 true 若頁麵取嚮被成功設為 orientation .

該函數在 Qt 5.3 引入。

另請參閱 pageLayout ().

bool QPagedPaintDevice:: setPageSize (const QPageSize & pageSize )

將頁麵大小設為 pageSize .

要獲取當前 QPageSize 使用 pageLayout (). pageSize ().

應先調用這當調用 QPainter::begin (),或立即調用在調用 newPage () 以將新頁麵尺寸應用到新頁麵之前。不應調用任何描繪方法,在調用 setPageSize() 和 newPage () 之間因為可能使用瞭錯誤的描繪規格。

返迴 true 若頁麵大小被成功設為 pageSize .

該函數在 Qt 5.3 引入。

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

[虛擬] void QPagedPaintDevice:: setPageSize ( PageSize size )

Sets the size of the a page to size .

另請參閱 setPageSizeMM ().

[虛擬] 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 ().