summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/painting/qpagedpaintdevice.cpp273
-rw-r--r--src/gui/painting/qpagedpaintdevice.h159
-rw-r--r--src/gui/painting/qpagedpaintdevice_p.h10
-rw-r--r--src/printsupport/kernel/qprinter.cpp196
-rw-r--r--src/printsupport/kernel/qprinter.h155
5 files changed, 640 insertions, 153 deletions
diff --git a/src/gui/painting/qpagedpaintdevice.cpp b/src/gui/painting/qpagedpaintdevice.cpp
index b95b3e3503..18ba964a26 100644
--- a/src/gui/painting/qpagedpaintdevice.cpp
+++ b/src/gui/painting/qpagedpaintdevice.cpp
@@ -44,42 +44,6 @@
QT_BEGIN_NAMESPACE
-static const struct {
- float width;
- float height;
-} pageSizes[] = {
- {210, 297}, // A4
- {176, 250}, // B5
- {215.9f, 279.4f}, // Letter
- {215.9f, 355.6f}, // Legal
- {190.5f, 254}, // Executive
- {841, 1189}, // A0
- {594, 841}, // A1
- {420, 594}, // A2
- {297, 420}, // A3
- {148, 210}, // A5
- {105, 148}, // A6
- {74, 105}, // A7
- {52, 74}, // A8
- {37, 52}, // A8
- {1000, 1414}, // B0
- {707, 1000}, // B1
- {31, 44}, // B10
- {500, 707}, // B2
- {353, 500}, // B3
- {250, 353}, // B4
- {125, 176}, // B6
- {88, 125}, // B7
- {62, 88}, // B8
- {44, 62}, // B9
- {163, 229}, // C5E
- {105, 241}, // US Common
- {110, 220}, // DLE
- {210, 330}, // Folio
- {431.8f, 279.4f}, // Ledger
- {279.4f, 431.8f} // Tabloid
-};
-
/*!
\class QPagedPaintDevice
\inmodule QtGui
@@ -110,46 +74,147 @@ QPagedPaintDevice::~QPagedPaintDevice()
}
/*!
- \enum QPagedPaintDevice::PageSize
-
- This enum type specifies the page size of the paint device.
-
- \value A0 841 x 1189 mm
- \value A1 594 x 841 mm
- \value A2 420 x 594 mm
- \value A3 297 x 420 mm
- \value A4 210 x 297 mm, 8.26 x 11.69 inches
- \value A5 148 x 210 mm
- \value A6 105 x 148 mm
- \value A7 74 x 105 mm
- \value A8 52 x 74 mm
- \value A9 37 x 52 mm
- \value B0 1000 x 1414 mm
- \value B1 707 x 1000 mm
- \value B2 500 x 707 mm
- \value B3 353 x 500 mm
- \value B4 250 x 353 mm
- \value B5 176 x 250 mm, 6.93 x 9.84 inches
- \value B6 125 x 176 mm
- \value B7 88 x 125 mm
- \value B8 62 x 88 mm
- \value B9 44 x 62 mm
- \value B10 31 x 44 mm
- \value C5E 163 x 229 mm
- \value Comm10E 105 x 241 mm, U.S. Common 10 Envelope
- \value DLE 110 x 220 mm
- \value Executive 7.5 x 10 inches, 190.5 x 254 mm
- \value Folio 210 x 330 mm
- \value Ledger 431.8 x 279.4 mm
- \value Legal 8.5 x 14 inches, 215.9 x 355.6 mm
- \value Letter 8.5 x 11 inches, 215.9 x 279.4 mm
- \value Tabloid 279.4 x 431.8 mm
- \value Custom Unknown, or a user defined size.
-
- \omitvalue NPageSize
-
- The page size can also be specified in millimeters using setPageSizeMM(). In this case the
- page size enum is set to Custom.
+ \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.
+
+ The defined sizes are:
+
+ \value A0 841 x 1189 mm
+ \value A1 594 x 841 mm
+ \value A2 420 x 594 mm
+ \value A3 297 x 420 mm
+ \value A4 210 x 297 mm, 8.26 x 11.69 inches
+ \value A5 148 x 210 mm
+ \value A6 105 x 148 mm
+ \value A7 74 x 105 mm
+ \value A8 52 x 74 mm
+ \value A9 37 x 52 mm
+ \value B0 1000 x 1414 mm
+ \value B1 707 x 1000 mm
+ \value B2 500 x 707 mm
+ \value B3 353 x 500 mm
+ \value B4 250 x 353 mm
+ \value B5 176 x 250 mm, 6.93 x 9.84 inches
+ \value B6 125 x 176 mm
+ \value B7 88 x 125 mm
+ \value B8 62 x 88 mm
+ \value B9 33 x 62 mm
+ \value B10 31 x 44 mm
+ \value C5E 163 x 229 mm
+ \value Comm10E 105 x 241 mm, U.S. Common 10 Envelope
+ \value DLE 110 x 220 mm
+ \value Executive 7.5 x 10 inches, 190.5 x 254 mm
+ \value Folio 210 x 330 mm
+ \value Ledger 431.8 x 279.4 mm
+ \value Legal 8.5 x 14 inches, 215.9 x 355.6 mm
+ \value Letter 8.5 x 11 inches, 215.9 x 279.4 mm
+ \value Tabloid 279.4 x 431.8 mm
+ \value Custom Unknown, or a user defined size.
+ \value A10
+ \value A3Extra
+ \value A4Extra
+ \value A4Plus
+ \value A4Small
+ \value A5Extra
+ \value B5Extra
+ \value JisB0
+ \value JisB1
+ \value JisB2
+ \value JisB3
+ \value JisB4
+ \value JisB5
+ \value JisB6,
+ \value JisB7
+ \value JisB8
+ \value JisB9
+ \value JisB10
+ \value AnsiA = Letter
+ \value AnsiB = Ledger
+ \value AnsiC
+ \value AnsiD
+ \value AnsiE
+ \value LegalExtra
+ \value LetterExtra
+ \value LetterPlus
+ \value LetterSmall
+ \value TabloidExtra
+ \value ArchA
+ \value ArchB
+ \value ArchC
+ \value ArchD
+ \value ArchE
+ \value Imperial7x9
+ \value Imperial8x10
+ \value Imperial9x11
+ \value Imperial9x12
+ \value Imperial10x11
+ \value Imperial10x13
+ \value Imperial10x14
+ \value Imperial12x11
+ \value Imperial15x11
+ \value ExecutiveStandard
+ \value Note
+ \value Quarto
+ \value Statement
+ \value SuperA
+ \value SuperB
+ \value Postcard
+ \value DoublePostcard
+ \value Prc16K
+ \value Prc32K
+ \value Prc32KBig
+ \value FanFoldUS
+ \value FanFoldGerman
+ \value FanFoldGermanLegal
+ \value EnvelopeB4
+ \value EnvelopeB5
+ \value EnvelopeB6
+ \value EnvelopeC0
+ \value EnvelopeC1
+ \value EnvelopeC2
+ \value EnvelopeC3
+ \value EnvelopeC4
+ \value EnvelopeC5 = C5E
+ \value EnvelopeC6
+ \value EnvelopeC65
+ \value EnvelopeC7
+ \value EnvelopeDL = DLE
+ \value Envelope9
+ \value Envelope10 = Comm10E
+ \value Envelope11
+ \value Envelope12
+ \value Envelope14
+ \value EnvelopeMonarch
+ \value EnvelopePersonal
+ \value EnvelopeChou3
+ \value EnvelopeChou4
+ \value EnvelopeInvite
+ \value EnvelopeItalian
+ \value EnvelopeKaku2
+ \value EnvelopeKaku3
+ \value EnvelopePrc1
+ \value EnvelopePrc2
+ \value EnvelopePrc3
+ \value EnvelopePrc4
+ \value EnvelopePrc5
+ \value EnvelopePrc6
+ \value EnvelopePrc7
+ \value EnvelopePrc8
+ \value EnvelopePrc9
+ \value EnvelopePrc10
+ \value EnvelopeYou4
+ \value LastPageSize = EnvelopeYou4
+ \omitvalue NPageSize
+ \omitvalue NPaperSize
+
+ Due to historic reasons QPageSize::Executive is not the same as the standard
+ Postscript and Windows Executive size, use QPageSize::ExecutiveStandard instead.
+
+ The Postscript standard size QPageSize::Folio is different to the Windows
+ DMPAPER_FOLIO size, use the Postscript standard size QPageSize::FanFoldGermanLegal
+ if needed.
*/
/*!
@@ -166,10 +231,7 @@ QPagedPaintDevice::~QPagedPaintDevice()
*/
void QPagedPaintDevice::setPageSize(PageSize size)
{
- if (size >= Custom)
- return;
- d->pageSize = size;
- d->pageSizeMM = QSizeF(pageSizes[size].width, pageSizes[size].height);
+ d->m_pageLayout.setPageSize(QPageSize(QPageSize::PageSizeId(size)));
}
/*!
@@ -177,16 +239,18 @@ void QPagedPaintDevice::setPageSize(PageSize size)
*/
QPagedPaintDevice::PageSize QPagedPaintDevice::pageSize() const
{
- return d->pageSize;
+ return PageSize(d->m_pageLayout.pageSize().id());
}
/*!
- Sets the page size to \a size. \a size is specified in millimeters.
- */
+ Sets the page size to \a size. \a 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.
+*/
void QPagedPaintDevice::setPageSizeMM(const QSizeF &size)
{
- d->pageSize = Custom;
- d->pageSizeMM = size;
+ d->m_pageLayout.setPageSize(QPageSize(size, QPageSize::Millimeter));
}
/*!
@@ -194,7 +258,7 @@ void QPagedPaintDevice::setPageSizeMM(const QSizeF &size)
*/
QSizeF QPagedPaintDevice::pageSizeMM() const
{
- return d->pageSizeMM;
+ return d->m_pageLayout.pageSize().size(QPageSize::Millimeter);
}
/*!
@@ -209,17 +273,48 @@ QSizeF QPagedPaintDevice::pageSizeMM() const
*/
void QPagedPaintDevice::setMargins(const Margins &margins)
{
- d->margins = margins;
+ d->m_pageLayout.setUnits(QPageLayout::Millimeter);
+ d->m_pageLayout.setMargins(QMarginsF(margins.left, margins.top, margins.right, margins.bottom));
}
/*!
- returns the current margins of the paint device. The default is 0.
+ Returns the current margins of the paint device. The default is 0.
+
+ Margins are specified in millimeters.
\sa setMargins()
*/
QPagedPaintDevice::Margins QPagedPaintDevice::margins() const
{
- return d->margins;
+ QMarginsF margins = d->m_pageLayout.margins(QPageLayout::Millimeter);
+ Margins result;
+ result.left = margins.left();
+ result.top = margins.top();
+ result.right = margins.right();
+ result.bottom = margins.bottom();
+ return result;
+}
+
+/*!
+ \internal
+
+ Returns the internal device page layout.
+*/
+
+QPageLayout QPagedPaintDevice::devicePageLayout() const
+{
+ return d->m_pageLayout;
+}
+
+/*!
+ \internal
+
+ Returns the internal device page layout.
+*/
+
+QPageLayout &QPagedPaintDevice::devicePageLayout()
+{
+ return d->m_pageLayout;
}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qpagedpaintdevice.h b/src/gui/painting/qpagedpaintdevice.h
index a4e8ff1a48..6d4c422a95 100644
--- a/src/gui/painting/qpagedpaintdevice.h
+++ b/src/gui/painting/qpagedpaintdevice.h
@@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE
#endif
class QPagedPaintDevicePrivate;
+class QPageLayout;
class Q_GUI_EXPORT QPagedPaintDevice : public QPaintDevice
{
@@ -61,10 +62,157 @@ public:
virtual bool newPage() = 0;
// ### Qt6 Remove in favor of QPage::PageSize
- enum PageSize { A4, B5, Letter, Legal, Executive,
- A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1,
- B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E,
- DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom };
+ // NOTE: Must keep in sync with QPageSize and QPrinter
+ enum PageSize {
+ // Existing Qt sizes
+ A4,
+ B5,
+ Letter,
+ Legal,
+ Executive,
+ A0,
+ A1,
+ A2,
+ A3,
+ A5,
+ A6,
+ A7,
+ A8,
+ A9,
+ B0,
+ B1,
+ B10,
+ B2,
+ B3,
+ B4,
+ B6,
+ B7,
+ B8,
+ B9,
+ C5E,
+ Comm10E,
+ DLE,
+ Folio,
+ Ledger,
+ Tabloid,
+ Custom,
+
+ // New values derived from PPD standard
+ A10,
+ A3Extra,
+ A4Extra,
+ A4Plus,
+ A4Small,
+ A5Extra,
+ B5Extra,
+
+ JisB0,
+ JisB1,
+ JisB2,
+ JisB3,
+ JisB4,
+ JisB5,
+ JisB6,
+ JisB7,
+ JisB8,
+ JisB9,
+ JisB10,
+
+ // AnsiA = Letter,
+ // AnsiB = Ledger,
+ AnsiC,
+ AnsiD,
+ AnsiE,
+ LegalExtra,
+ LetterExtra,
+ LetterPlus,
+ LetterSmall,
+ TabloidExtra,
+
+ ArchA,
+ ArchB,
+ ArchC,
+ ArchD,
+ ArchE,
+
+ Imperial7x9,
+ Imperial8x10,
+ Imperial9x11,
+ Imperial9x12,
+ Imperial10x11,
+ Imperial10x13,
+ Imperial10x14,
+ Imperial12x11,
+ Imperial15x11,
+
+ ExecutiveStandard,
+ Note,
+ Quarto,
+ Statement,
+ SuperA,
+ SuperB,
+ Postcard,
+ DoublePostcard,
+ Prc16K,
+ Prc32K,
+ Prc32KBig,
+
+ FanFoldUS,
+ FanFoldGerman,
+ FanFoldGermanLegal,
+
+ EnvelopeB4,
+ EnvelopeB5,
+ EnvelopeB6,
+ EnvelopeC0,
+ EnvelopeC1,
+ EnvelopeC2,
+ EnvelopeC3,
+ EnvelopeC4,
+ // EnvelopeC5 = C5E,
+ EnvelopeC6,
+ EnvelopeC65,
+ EnvelopeC7,
+ // EnvelopeDL = DLE,
+
+ Envelope9,
+ // Envelope10 = Comm10E,
+ Envelope11,
+ Envelope12,
+ Envelope14,
+ EnvelopeMonarch,
+ EnvelopePersonal,
+
+ EnvelopeChou3,
+ EnvelopeChou4,
+ EnvelopeInvite,
+ EnvelopeItalian,
+ EnvelopeKaku2,
+ EnvelopeKaku3,
+ EnvelopePrc1,
+ EnvelopePrc2,
+ EnvelopePrc3,
+ EnvelopePrc4,
+ EnvelopePrc5,
+ EnvelopePrc6,
+ EnvelopePrc7,
+ EnvelopePrc8,
+ EnvelopePrc9,
+ EnvelopePrc10,
+ EnvelopeYou4,
+
+ // Last item, with commonly used synynoms from QPagedPrintEngine / QPrinter
+ LastPageSize = EnvelopeYou4,
+ NPageSize = LastPageSize,
+ NPaperSize = LastPageSize,
+
+ // Convenience overloads for naming consistency
+ AnsiA = Letter,
+ AnsiB = Ledger,
+ EnvelopeC5 = C5E,
+ EnvelopeDL = DLE,
+ Envelope10 = Comm10E
+ };
virtual void setPageSize(PageSize size);
PageSize pageSize() const;
@@ -72,6 +220,7 @@ public:
virtual void setPageSizeMM(const QSizeF &size);
QSizeF pageSizeMM() const;
+ // ### Qt6 Remove in favor of QMarginsF
struct Margins {
qreal left;
qreal right;
@@ -83,6 +232,8 @@ public:
Margins margins() const;
protected:
+ QPageLayout devicePageLayout() const;
+ QPageLayout &devicePageLayout();
friend class QPagedPaintDevicePrivate;
QPagedPaintDevicePrivate *d;
};
diff --git a/src/gui/painting/qpagedpaintdevice_p.h b/src/gui/painting/qpagedpaintdevice_p.h
index d9e5d43903..da58951dc7 100644
--- a/src/gui/painting/qpagedpaintdevice_p.h
+++ b/src/gui/painting/qpagedpaintdevice_p.h
@@ -55,27 +55,25 @@
#include <qpagedpaintdevice.h>
+#include "qpagelayout.h"
+
QT_BEGIN_NAMESPACE
class Q_GUI_EXPORT QPagedPaintDevicePrivate
{
public:
QPagedPaintDevicePrivate()
- : pageSize(QPagedPaintDevice::A4),
- pageSizeMM(210, 297),
+ : m_pageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0, 0, 0, 0)),
fromPage(0),
toPage(0),
pageOrderAscending(true),
printSelectionOnly(false)
{
- margins.left = margins.right = margins.top = margins.bottom = 0;
}
static inline QPagedPaintDevicePrivate *get(QPagedPaintDevice *pd) { return pd->d; }
- QPagedPaintDevice::PageSize pageSize;
- QSizeF pageSizeMM;
- QPagedPaintDevice::Margins margins;
+ QPageLayout m_pageLayout;
// These are currently required to keep QPrinter functionality working in QTextDocument::print()
int fromPage;
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 9e9a0625d7..878dac60d5 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -418,57 +418,153 @@ void QPrinterPrivate::setProperty(QPrintEngine::PrintEnginePropertyKey key, cons
*/
/*!
- \enum QPrinter::PaperSize
- \since 4.4
+ \enum QPrinter::PaperSize
+ \since 4.4
- This enum type specifies what paper size QPrinter should use.
- QPrinter does not check that the paper size is available; it just
- uses this information, together with QPrinter::Orientation and
- QPrinter::setFullPage(), to determine the printable area.
-
- The defined sizes (with setFullPage(true)) are:
-
- \value A0 841 x 1189 mm
- \value A1 594 x 841 mm
- \value A2 420 x 594 mm
- \value A3 297 x 420 mm
- \value A4 210 x 297 mm, 8.26 x 11.69 inches
- \value A5 148 x 210 mm
- \value A6 105 x 148 mm
- \value A7 74 x 105 mm
- \value A8 52 x 74 mm
- \value A9 37 x 52 mm
- \value B0 1000 x 1414 mm
- \value B1 707 x 1000 mm
- \value B2 500 x 707 mm
- \value B3 353 x 500 mm
- \value B4 250 x 353 mm
- \value B5 176 x 250 mm, 6.93 x 9.84 inches
- \value B6 125 x 176 mm
- \value B7 88 x 125 mm
- \value B8 62 x 88 mm
- \value B9 44 x 62 mm
- \value B10 31 x 44 mm
- \value C5E 163 x 229 mm
- \value Comm10E 105 x 241 mm, U.S. Common 10 Envelope
- \value DLE 110 x 220 mm
- \value Executive 7.5 x 10 inches, 190.5 x 254 mm
- \value Folio 210 x 330 mm
- \value Ledger 431.8 x 279.4 mm
- \value Legal 8.5 x 14 inches, 215.9 x 355.6 mm
- \value Letter 8.5 x 11 inches, 215.9 x 279.4 mm
- \value Tabloid 279.4 x 431.8 mm
- \value Custom Unknown, or a user defined size.
-
- With setFullPage(false) (the default), the metrics will be a bit
- smaller; how much depends on the printer in use.
-
- \note QPrinter::Folio is the Adobe specification for the Folio size.
- On Windows if you want to use the same as DMPAPER_FOLIO then you should use
- setPaperSize(QSizeF(8.5, 13), QPrinter::Inch).
-
- \omitvalue NPageSize
- \omitvalue NPaperSize
+ This enum type specifies what paper size QPrinter should use.
+ QPrinter does not check that the paper size is available; it just
+ uses this information, together with QPrinter::Orientation and
+ QPrinter::setFullPage(), to determine the printable area.
+
+ The defined sizes (with setFullPage(true)) are:
+
+ \value A0 841 x 1189 mm
+ \value A1 594 x 841 mm
+ \value A2 420 x 594 mm
+ \value A3 297 x 420 mm
+ \value A4 210 x 297 mm, 8.26 x 11.69 inches
+ \value A5 148 x 210 mm
+ \value A6 105 x 148 mm
+ \value A7 74 x 105 mm
+ \value A8 52 x 74 mm
+ \value A9 37 x 52 mm
+ \value B0 1000 x 1414 mm
+ \value B1 707 x 1000 mm
+ \value B2 500 x 707 mm
+ \value B3 353 x 500 mm
+ \value B4 250 x 353 mm
+ \value B5 176 x 250 mm, 6.93 x 9.84 inches
+ \value B6 125 x 176 mm
+ \value B7 88 x 125 mm
+ \value B8 62 x 88 mm
+ \value B9 33 x 62 mm
+ \value B10 31 x 44 mm
+ \value C5E 163 x 229 mm
+ \value Comm10E 105 x 241 mm, U.S. Common 10 Envelope
+ \value DLE 110 x 220 mm
+ \value Executive 7.5 x 10 inches, 190.5 x 254 mm
+ \value Folio 210 x 330 mm
+ \value Ledger 431.8 x 279.4 mm
+ \value Legal 8.5 x 14 inches, 215.9 x 355.6 mm
+ \value Letter 8.5 x 11 inches, 215.9 x 279.4 mm
+ \value Tabloid 279.4 x 431.8 mm
+ \value Custom Unknown, or a user defined size.
+ \value A10
+ \value A3Extra
+ \value A4Extra
+ \value A4Plus
+ \value A4Small
+ \value A5Extra
+ \value B5Extra
+ \value JisB0
+ \value JisB1
+ \value JisB2
+ \value JisB3
+ \value JisB4
+ \value JisB5
+ \value JisB6,
+ \value JisB7
+ \value JisB8
+ \value JisB9
+ \value JisB10
+ \value AnsiA = Letter
+ \value AnsiB = Ledger
+ \value AnsiC
+ \value AnsiD
+ \value AnsiE
+ \value LegalExtra
+ \value LetterExtra
+ \value LetterPlus
+ \value LetterSmall
+ \value TabloidExtra
+ \value ArchA
+ \value ArchB
+ \value ArchC
+ \value ArchD
+ \value ArchE
+ \value Imperial7x9
+ \value Imperial8x10
+ \value Imperial9x11
+ \value Imperial9x12
+ \value Imperial10x11
+ \value Imperial10x13
+ \value Imperial10x14
+ \value Imperial12x11
+ \value Imperial15x11
+ \value ExecutiveStandard
+ \value Note
+ \value Quarto
+ \value Statement
+ \value SuperA
+ \value SuperB
+ \value Postcard
+ \value DoublePostcard
+ \value Prc16K
+ \value Prc32K
+ \value Prc32KBig
+ \value FanFoldUS
+ \value FanFoldGerman
+ \value FanFoldGermanLegal
+ \value EnvelopeB4
+ \value EnvelopeB5
+ \value EnvelopeB6
+ \value EnvelopeC0
+ \value EnvelopeC1
+ \value EnvelopeC2
+ \value EnvelopeC3
+ \value EnvelopeC4
+ \value EnvelopeC5 = C5E
+ \value EnvelopeC6
+ \value EnvelopeC65
+ \value EnvelopeC7
+ \value EnvelopeDL = DLE
+ \value Envelope9
+ \value Envelope10 = Comm10E
+ \value Envelope11
+ \value Envelope12
+ \value Envelope14
+ \value EnvelopeMonarch
+ \value EnvelopePersonal
+ \value EnvelopeChou3
+ \value EnvelopeChou4
+ \value EnvelopeInvite
+ \value EnvelopeItalian
+ \value EnvelopeKaku2
+ \value EnvelopeKaku3
+ \value EnvelopePrc1
+ \value EnvelopePrc2
+ \value EnvelopePrc3
+ \value EnvelopePrc4
+ \value EnvelopePrc5
+ \value EnvelopePrc6
+ \value EnvelopePrc7
+ \value EnvelopePrc8
+ \value EnvelopePrc9
+ \value EnvelopePrc10
+ \value EnvelopeYou4
+ \value LastPageSize = EnvelopeYou4
+ \omitvalue NPageSize
+ \omitvalue NPaperSize
+
+ With setFullPage(false) (the default), the metrics will be a bit
+ smaller; how much depends on the printer in use.
+
+ Due to historic reasons QPageSize::Executive is not the same as the standard
+ Postscript and Windows Executive size, use QPageSize::ExecutiveStandard instead.
+
+ The Postscript standard size QPageSize::Folio is different to the Windows
+ DMPAPER_FOLIO size, use the Postscript standard size QPageSize::FanFoldGermanLegal
+ if needed.
*/
diff --git a/src/printsupport/kernel/qprinter.h b/src/printsupport/kernel/qprinter.h
index 17afdc2157..f842c222f6 100644
--- a/src/printsupport/kernel/qprinter.h
+++ b/src/printsupport/kernel/qprinter.h
@@ -76,13 +76,160 @@ public:
enum Orientation { Portrait, Landscape };
// ### Qt6 Remove in favor of QPage::PageSize
+ // NOTE: Must keep in sync with QPageSize and QPagedPaintDevice
#ifndef Q_QDOC
typedef PageSize PaperSize;
#else
- enum PaperSize { A4, B5, Letter, Legal, Executive,
- A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1,
- B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E,
- DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom, NPaperSize = Custom };
+ enum PaperSize {
+ // Existing Qt sizes
+ A4,
+ B5,
+ Letter,
+ Legal,
+ Executive,
+ A0,
+ A1,
+ A2,
+ A3,
+ A5,
+ A6,
+ A7,
+ A8,
+ A9,
+ B0,
+ B1,
+ B10,
+ B2,
+ B3,
+ B4,
+ B6,
+ B7,
+ B8,
+ B9,
+ C5E,
+ Comm10E,
+ DLE,
+ Folio,
+ Ledger,
+ Tabloid,
+ Custom,
+
+ // New values derived from PPD standard
+ A10,
+ A3Extra,
+ A4Extra,
+ A4Plus,
+ A4Small,
+ A5Extra,
+ B5Extra,
+
+ JisB0,
+ JisB1,
+ JisB2,
+ JisB3,
+ JisB4,
+ JisB5,
+ JisB6,
+ JisB7,
+ JisB8,
+ JisB9,
+ JisB10,
+
+ // AnsiA = Letter,
+ // AnsiB = Ledger,
+ AnsiC,
+ AnsiD,
+ AnsiE,
+ LegalExtra,
+ LetterExtra,
+ LetterPlus,
+ LetterSmall,
+ TabloidExtra,
+
+ ArchA,
+ ArchB,
+ ArchC,
+ ArchD,
+ ArchE,
+
+ Imperial7x9,
+ Imperial8x10,
+ Imperial9x11,
+ Imperial9x12,
+ Imperial10x11,
+ Imperial10x13,
+ Imperial10x14,
+ Imperial12x11,
+ Imperial15x11,
+
+ ExecutiveStandard,
+ Note,
+ Quarto,
+ Statement,
+ SuperA,
+ SuperB,
+ Postcard,
+ DoublePostcard,
+ Prc16K,
+ Prc32K,
+ Prc32KBig,
+
+ FanFoldUS,
+ FanFoldGerman,
+ FanFoldGermanLegal,
+
+ EnvelopeB4,
+ EnvelopeB5,
+ EnvelopeB6,
+ EnvelopeC0,
+ EnvelopeC1,
+ EnvelopeC2,
+ EnvelopeC3,
+ EnvelopeC4,
+ // EnvelopeC5 = C5E,
+ EnvelopeC6,
+ EnvelopeC65,
+ EnvelopeC7,
+ // EnvelopeDL = DLE,
+
+ Envelope9,
+ // Envelope10 = Comm10E,
+ Envelope11,
+ Envelope12,
+ Envelope14,
+ EnvelopeMonarch,
+ EnvelopePersonal,
+
+ EnvelopeChou3,
+ EnvelopeChou4,
+ EnvelopeInvite,
+ EnvelopeItalian,
+ EnvelopeKaku2,
+ EnvelopeKaku3,
+ EnvelopePrc1,
+ EnvelopePrc2,
+ EnvelopePrc3,
+ EnvelopePrc4,
+ EnvelopePrc5,
+ EnvelopePrc6,
+ EnvelopePrc7,
+ EnvelopePrc8,
+ EnvelopePrc9,
+ EnvelopePrc10,
+ EnvelopeYou4,
+
+ // Last item, with commonly used synynoms from QPagedPrintEngine / QPrinter
+ LastPageSize = EnvelopeYou4,
+ NPageSize = LastPageSize,
+ NPaperSize = LastPageSize,
+
+ // Convenience overloads for naming consistency
+ AnsiA = Letter,
+ AnsiB = Ledger,
+ EnvelopeC5 = C5E,
+ EnvelopeDL = DLE,
+ Envelope10 = Comm10E
+ };
#endif
enum PageOrder { FirstPageFirst,