Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPageSize Class Reference

\inmodule QtGui More...

#include <qpagesize.h>

+ Collaboration diagram for QPageSize:

Public Types

enum  PageSizeId {
  Letter , Legal , Executive , A0 ,
  A1 , A2 , A3 , A4 ,
  A5 , A6 , A7 , A8 ,
  A9 , A10 , B0 , B1 ,
  B2 , B3 , B4 , B5 ,
  B6 , B7 , B8 , B9 ,
  B10 , C5E , Comm10E , DLE ,
  Folio , Ledger , Tabloid , Custom ,
  A3Extra , A4Extra , A4Plus , A4Small ,
  A5Extra , B5Extra , JisB0 , JisB1 ,
  JisB2 , JisB3 , JisB4 , JisB5 ,
  JisB6 , JisB7 , JisB8 , JisB9 ,
  JisB10 , 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 , EnvelopeC6 , EnvelopeC65 , EnvelopeC7 ,
  Envelope9 , Envelope11 , Envelope12 , Envelope14 ,
  EnvelopeMonarch , EnvelopePersonal , EnvelopeChou3 , EnvelopeChou4 ,
  EnvelopeInvite , EnvelopeItalian , EnvelopeKaku2 , EnvelopeKaku3 ,
  EnvelopePrc1 , EnvelopePrc2 , EnvelopePrc3 , EnvelopePrc4 ,
  EnvelopePrc5 , EnvelopePrc6 , EnvelopePrc7 , EnvelopePrc8 ,
  EnvelopePrc9 , EnvelopePrc10 , EnvelopeYou4 , LastPageSize = EnvelopeYou4 ,
  AnsiA = Letter , AnsiB = Ledger , EnvelopeC5 = C5E , EnvelopeDL = DLE ,
  Envelope10 = Comm10E
}
 This enum type lists the available page sizes as defined in the Postscript PPD standard. More...
 
enum  Unit {
  Millimeter , Point , Inch , Pica ,
  Didot , Cicero
}
 This enum type is used to specify the measurement unit for page sizes. More...
 
enum  SizeMatchPolicy { FuzzyMatch , FuzzyOrientationMatch , ExactMatch }
 \value FuzzyMatch Match to a standard page size if within the margin of tolerance. More...
 

Public Member Functions

 QPageSize ()
 Creates a null QPageSize.
 
Q_IMPLICIT QPageSize (PageSizeId pageSizeId)
 Creates a QPageSize of the standard pageSize.
 
 QPageSize (const QSize &pointSize, const QString &name=QString(), SizeMatchPolicy matchPolicy=FuzzyMatch)
 Creates a QPageSize of the given pointSize in Points using the matching matchPolicy.
 
 QPageSize (const QSizeF &size, Unit units, const QString &name=QString(), SizeMatchPolicy matchPolicy=FuzzyMatch)
 Creates a custom page of the given size in units.
 
 QPageSize (const QPageSize &other)
 Copy constructor, copies other to this.
 
QPageSizeoperator= (const QPageSize &other)
 Assignment operator, assigns other to this.
 
 ~QPageSize ()
 Destroys the page.
 
void swap (QPageSize &other) noexcept
 Swaps this QPageSize with other.
 
bool isEquivalentTo (const QPageSize &other) const
 Returns true if this page is equivalent to the other page, i.e.
 
bool isValid () const
 Returns true if this page size is valid.
 
QString key () const
 Returns the unique key of the page size.
 
QString name () const
 Returns a localized human-readable name for the page size.
 
PageSizeId id () const
 Returns the standard QPageSize::PageSizeId of the page, or QPageSize::Custom.
 
int windowsId () const
 Returns the Windows DMPAPER enum value for the page size.
 
QSizeF definitionSize () const
 Returns the definition size of the page size.
 
Unit definitionUnits () const
 Returns the definition units of the page size.
 
QSizeF size (Unit units) const
 Returns the size of the page in the required units.
 
QSize sizePoints () const
 Returns the size of the page in Postscript Points (1/72 of an inch).
 
QSize sizePixels (int resolution) const
 Returns the size of the page in Device Pixels at the given resolution.
 
QRectF rect (Unit units) const
 Returns the page rectangle in the required units.
 
QRect rectPoints () const
 Returns the page rectangle in Postscript Points (1/72 of an inch).
 
QRect rectPixels (int resolution) const
 Returns the page rectangle in Device Pixels at the given resolution.
 

Static Public Member Functions

static QString key (PageSizeId pageSizeId)
 Returns the PPD mediaOption keyword of the standard pageSizeId.
 
static QString name (PageSizeId pageSizeId)
 Returns the localized name of the standard pageSizeId.
 
static PageSizeId id (const QSize &pointSize, SizeMatchPolicy matchPolicy=FuzzyMatch)
 Returns the standard QPageSize::PageSizeId of the given pointSize in points using the given matchPolicy.
 
static PageSizeId id (const QSizeF &size, Unit units, SizeMatchPolicy matchPolicy=FuzzyMatch)
 Returns the standard QPageSize::PageSizeId of the given size in units using the given matchPolicy.
 
static PageSizeId id (int windowsId)
 Returns the PageSizeId for the given Windows DMPAPER enum value windowsId.
 
static int windowsId (PageSizeId pageSizeId)
 Returns the Windows DMPAPER enum value of the standard pageSizeId.
 
static QSizeF definitionSize (PageSizeId pageSizeId)
 Returns the definition size of the standard pageSizeId.
 
static Unit definitionUnits (PageSizeId pageSizeId)
 Returns the definition units of the standard pageSizeId.
 
static QSizeF size (PageSizeId pageSizeId, Unit units)
 Returns the size of the standard pageSizeId in the requested units.
 
static QSize sizePoints (PageSizeId pageSizeId)
 Returns the size of the standard pageSizeId in Points.
 
static QSize sizePixels (PageSizeId pageSizeId, int resolution)
 Returns the size of the standard pageSizeId in Device Pixels for the given resolution.
 

Friends

class QPageSizePrivate
 
class QPlatformPrintDevice
 
bool operator== (const QPageSize &lhs, const QPageSize &rhs)
 Returns true if page size lhs is equal to page size rhs, i.e.
 
bool operator!= (const QPageSize &lhs, const QPageSize &rhs)
 Returns true if page size lhs is unequal to page size rhs, i.e.
 

Detailed Description

\inmodule QtGui

Since
5.3

The QPageSize class describes the size and name of a defined page size.

This class implements support for the set of standard page sizes as defined in the Adobe Postscript PPD Standard v4.3. It defines the standard set of page sizes in points, millimeters and inches and ensures these sizes are consistently used. Other size units can be used but will be calculated results and so may not always be consistent. The defined point sizes are always a integer, all other sizes can be fractions of a unit.

The defined size is always in width x height order with no implied page orientation. Note that it is possible for page sizes to be defined where the width is greater than the height, such as QPageSize::Ledger, so you cannot rely on comparing the width and height values to determine page orientation.

For example, A4 is defined by the standard as 210mm x 297mm, 8.27in x 11.69in, or 595pt x 842pt.

You can also define custom page sizes with custom names in any units you want and this unit size will be preserved and used as the base for all other unit size calculations.

When creating a QPageSize using a custom QSize you can choose if you want QPageSize to try match the size to a standard page size. By default QPaperSize uses a FuzzyMatch mode where it will match a given page size to a standard page size if it falls within 3 postscript points of a defined standard size. You can override this to request only an exact match but this is not recommended as conversions between units can easily lose 3 points and result in incorrect page sizes.

A QPageSize instance may also be obtained by querying the supported page sizes for a print device. In this case the localized name returned is that defined by the printer itself. Note that the print device may not support the current default locale language.

The class also provides convenience methods for converting page size IDs to and from various unit sizes.

See also
QPagedPaintDevice, QPdfWriter

Definition at line 21 of file qpagesize.h.

Member Enumeration Documentation

◆ PageSizeId

This enum type lists the available page sizes as defined in the Postscript PPD standard.

These values are duplicated in QPagedPaintDevice 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 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. \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

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.

Enumerator
Letter 
Legal 
Executive 
A0 
A1 
A2 
A3 
A4 
A5 
A6 
A7 
A8 
A9 
A10 
B0 
B1 
B2 
B3 
B4 
B5 
B6 
B7 
B8 
B9 
B10 
C5E 
Comm10E 
DLE 
Folio 
Ledger 
Tabloid 
Custom 
A3Extra 
A4Extra 
A4Plus 
A4Small 
A5Extra 
B5Extra 
JisB0 
JisB1 
JisB2 
JisB3 
JisB4 
JisB5 
JisB6 
JisB7 
JisB8 
JisB9 
JisB10 
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 
EnvelopeC6 
EnvelopeC65 
EnvelopeC7 
Envelope9 
Envelope11 
Envelope12 
Envelope14 
EnvelopeMonarch 
EnvelopePersonal 
EnvelopeChou3 
EnvelopeChou4 
EnvelopeInvite 
EnvelopeItalian 
EnvelopeKaku2 
EnvelopeKaku3 
EnvelopePrc1 
EnvelopePrc2 
EnvelopePrc3 
EnvelopePrc4 
EnvelopePrc5 
EnvelopePrc6 
EnvelopePrc7 
EnvelopePrc8 
EnvelopePrc9 
EnvelopePrc10 
EnvelopeYou4 
LastPageSize 
AnsiA 
AnsiB 
EnvelopeC5 
EnvelopeDL 
Envelope10 

Definition at line 25 of file qpagesize.h.

◆ SizeMatchPolicy

\value FuzzyMatch Match to a standard page size if within the margin of tolerance.

\value FuzzyOrientationMatch Match to a standard page size if within the margin of tolerance regardless of orientation. \value ExactMatch Only match to a standard page size if the sizes match exactly.

Enumerator
FuzzyMatch 
FuzzyOrientationMatch 
ExactMatch 

Definition at line 184 of file qpagesize.h.

◆ Unit

This enum type is used to specify the measurement unit for page sizes.

\value Millimeter \value Point 1/72th of an inch \value Inch \value Pica 1/72th of a foot, 1/6th of an inch, 12 Points \value Didot 1/72th of a French inch, 0.375 mm \value Cicero 1/6th of a French inch, 12 Didot, 4.5mm

Enumerator
Millimeter 
Point 
Inch 
Pica 
Didot 
Cicero 

Definition at line 175 of file qpagesize.h.

Constructor & Destructor Documentation

◆ QPageSize() [1/5]

QPageSize::QPageSize ( )

Creates a null QPageSize.

Definition at line 1087 of file qpagesize.cpp.

◆ QPageSize() [2/5]

QPageSize::QPageSize ( PageSizeId pageSize)

Creates a QPageSize of the standard pageSize.

If pageSize is QPageSize::Custom then the resulting QPageSize will not be valid. Use the custom size constructor instead.

Definition at line 1099 of file qpagesize.cpp.

◆ QPageSize() [3/5]

QPageSize::QPageSize ( const QSize & pointSize,
const QString & name = QString(),
SizeMatchPolicy matchPolicy = FuzzyMatch )
explicit

Creates a QPageSize of the given pointSize in Points using the matching matchPolicy.

If the given pointSize matches a standard QPageSize::PageSizeId, then that page size will be used. Note that if the matchPolicy is FuzzyMatch this may result in the pointSize being adjusted to the standard size. To prevent this happening use a matchPolicy of ExactMatch instead.

If the given pointSize is not a standard QPageSize::PageSizeId then a QPageSize::Custom size will be created.

If name is null then the standard localized name will be used. If a custom page size then a custom name in the format "Custom (width x height)" will be created.

The matchPolicy defaults to FuzzyMatch.

Definition at line 1121 of file qpagesize.cpp.

◆ QPageSize() [4/5]

QPageSize::QPageSize ( const QSizeF & size,
Unit units,
const QString & name = QString(),
SizeMatchPolicy matchPolicy = FuzzyMatch )
explicit

Creates a custom page of the given size in units.

If the given size matches a standard QPageSize::PageSizeId, then that page size will be used. Note that if the matchPolicy is FuzzyMatch this may result in the size being adjusted to the standard size. To prevent this happening use a matchPolicy of ExactMatch instead.

If the given size is not a standard QPageSize::PageSizeId then a QPageSize::Custom size will be created. The original unit size will be preserved and used as the base for all other unit size calculations.

If name is null then a custom name will be created in the form "Custom (width x height)" where the size is expressed in units provided.

Definition at line 1142 of file qpagesize.cpp.

◆ QPageSize() [5/5]

QPageSize::QPageSize ( const QPageSize & other)

Copy constructor, copies other to this.

Definition at line 1185 of file qpagesize.cpp.

◆ ~QPageSize()

QPageSize::~QPageSize ( )

Destroys the page.

Definition at line 1194 of file qpagesize.cpp.

Member Function Documentation

◆ definitionSize() [1/2]

QSizeF QPageSize::definitionSize ( ) const

Returns the definition size of the page size.

For a standard page size this will be the size as defined in the relevant standard, i.e. ISO A4 will be defined in millimeters while ANSI Letter will be defined in inches.

For a custom page size this will be the original size used to create the page size object.

If the QPageSize is invalid then the QSizeF will be invalid.

See also
definitionUnits()

Definition at line 1351 of file qpagesize.cpp.

References isValid().

+ Here is the call graph for this function:

◆ definitionSize() [2/2]

QSizeF QPageSize::definitionSize ( PageSizeId pageSizeId)
static

Returns the definition size of the standard pageSizeId.

To obtain the definition units, call QPageSize::definitionUnits().

Definition at line 1777 of file qpagesize.cpp.

References Custom, and qt_definitionSize().

+ Here is the call graph for this function:

◆ definitionUnits() [1/2]

QPageSize::Unit QPageSize::definitionUnits ( ) const

Returns the definition units of the page size.

For a standard page size this will be the units as defined in the relevant standard, i.e. ISO A4 will be defined in millimeters while ANSI Letter will be defined in inches.

For a custom page size this will be the original units used to create the page size object.

If the QPageSize is invalid then the QPageSize::Unit will be invalid.

See also
definitionSize()

Definition at line 1371 of file qpagesize.cpp.

References isValid().

+ Here is the call graph for this function:

◆ definitionUnits() [2/2]

QPageSize::Unit QPageSize::definitionUnits ( PageSizeId pageSizeId)
static

Returns the definition units of the standard pageSizeId.

To obtain the definition size, call QPageSize::definitionSize().

Definition at line 1790 of file qpagesize.cpp.

References Custom, and qt_pageSizes.

◆ id() [1/4]

QPageSize::PageSizeId QPageSize::id ( ) const

Returns the standard QPageSize::PageSizeId of the page, or QPageSize::Custom.

If the QPageSize is invalid then the ID will be QPageSize::Custom.

Definition at line 1313 of file qpagesize.cpp.

References Custom, and isValid().

Referenced by operator<<(), QWindowsPrintDevice::printableMargins(), QMacPrintEngine::setProperty(), QCupsPrintEngine::setProperty(), QPdfPrintEngine::setProperty(), QWin32PrintEngine::setProperty(), QPlatformPrintDevice::supportedPageSize(), and QWin32PrintEnginePrivate::updatePageLayout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ id() [2/4]

QPageSize::PageSizeId QPageSize::id ( const QSize & pointSize,
SizeMatchPolicy matchPolicy = FuzzyMatch )
static

Returns the standard QPageSize::PageSizeId of the given pointSize in points using the given matchPolicy.

If using FuzzyMatch then the point size of the PageSizeId returned may not exactly match the pointSize you passed in. You should call QPageSize::sizePoints() using the returned PageSizeId to find out the actual point size of the PageSizeId before using it in any calculations.

Definition at line 1727 of file qpagesize.cpp.

References qt_idForPointSize().

+ Here is the call graph for this function:

◆ id() [3/4]

QPageSize::PageSizeId QPageSize::id ( const QSizeF & size,
Unit units,
SizeMatchPolicy matchPolicy = FuzzyMatch )
static

Returns the standard QPageSize::PageSizeId of the given size in units using the given matchPolicy.

If using FuzzyMatch then the unit size of the PageSizeId returned may not exactly match the size you passed in. You should call QPageSize::size() using the returned PageSizeId to find out the actual unit size of the PageSizeId before using it in any calculations.

Definition at line 1742 of file qpagesize.cpp.

References qt_idForSize().

+ Here is the call graph for this function:

◆ id() [4/4]

QPageSize::PageSizeId QPageSize::id ( int windowsId)
static

Returns the PageSizeId for the given Windows DMPAPER enum value windowsId.

If there is no matching PageSizeId then QPageSize::Custom is returned.

Definition at line 1754 of file qpagesize.cpp.

References qt_idForWindowsID(), and windowsId().

+ Here is the call graph for this function:

◆ isEquivalentTo()

bool QPageSize::isEquivalentTo ( const QPageSize & other) const

Returns true if this page is equivalent to the other page, i.e.

if the page has the same size regardless of other attributes like name.

Definition at line 1252 of file qpagesize.cpp.

References QPageSizePrivate::isEquivalentTo(), and other().

Referenced by QPageLayoutPrivate::isEquivalentTo(), QPdfPagedPaintDevicePrivate::setPageSize(), and QPrinterPagedPaintDevicePrivate::setPageSize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValid()

bool QPageSize::isValid ( ) const

Returns true if this page size is valid.

The page size may be invalid if created with an invalid PageSizeId, or a negative or invalid QSize or QSizeF, or the null constructor.

Definition at line 1266 of file qpagesize.cpp.

References QPageSizePrivate::isValid().

Referenced by definitionSize(), definitionUnits(), id(), QPageLayoutPrivate::isValid(), key(), QPpdPrintDevice::loadPageSizes(), QCocoaPrintDevice::loadPageSizes(), name(), operator<<(), rect(), rectPixels(), rectPoints(), QMacPrintEnginePrivate::setPageSize(), QWin32PrintEnginePrivate::setPageSize(), QPageLayout::setPageSize(), QPdfPrintEngine::setProperty(), QWin32PrintEngine::setProperty(), size(), sizePixels(), sizePoints(), QPlatformPrintDevice::supportedPageSize(), and windowsId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ key() [1/2]

QString QPageSize::key ( ) const

Returns the unique key of the page size.

By default this is the PPD standard mediaOption keyword for the page size, or the PPD custom format key. If the QPageSize instance was obtained from a print device then this will be the key provided by the print device and may differ from the standard key.

If the QPageSize is invalid then the key will be an empty string.

This key should never be shown to end users, it is an internal key only. For a human-readable name use name().

See also
name()

Definition at line 1287 of file qpagesize.cpp.

References isValid().

Referenced by QCupsPrintEnginePrivate::closePrintDevice(), QCocoaPrintDevice::loadPageSizes(), QCocoaPrintDevice::macPaper(), operator<<(), QPpdPrintDevice::printableMargins(), and QCocoaPrintDevice::printableMargins().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ key() [2/2]

QString QPageSize::key ( PageSizeId pageSizeId)
static

Returns the PPD mediaOption keyword of the standard pageSizeId.

If the QPageSize is invalid then the key will be empty.

Definition at line 1450 of file qpagesize.cpp.

References QString::fromUtf8(), LastPageSize, and qt_pageSizes.

+ Here is the call graph for this function:

◆ name() [1/2]

QString QPageSize::name ( ) const

Returns a localized human-readable name for the page size.

If the QPageSize instance was obtained from a print device then the name used is that provided by the print device. Note that a print device may not support the current default locale language.

If the QPageSize is invalid then the name will be an empty string.

Definition at line 1302 of file qpagesize.cpp.

References isValid().

Referenced by QCocoaPrintDevice::macPaper(), operator<<(), QPdfPrintEngine::setProperty(), and QPlatformPrintDevice::supportedPageSize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ name() [2/2]

QString QPageSize::name ( PageSizeId pageSizeId)
static

Returns the localized name of the standard pageSizeId.

If the QPageSize is invalid then the name will be empty.

Definition at line 1469 of file qpagesize.cpp.

References A0, A1, A10, A2, A3, A3Extra, A4, A4Extra, A4Plus, A4Small, A5, A5Extra, A6, A7, A8, A9, AnsiC, AnsiD, AnsiE, ArchA, ArchB, ArchC, ArchD, ArchE, B0, B1, B10, B2, B3, B4, B5, B5Extra, B6, B7, B8, B9, Custom, DoublePostcard, Envelope10, Envelope11, Envelope12, Envelope14, Envelope9, EnvelopeB4, EnvelopeB5, EnvelopeB6, EnvelopeC0, EnvelopeC1, EnvelopeC2, EnvelopeC3, EnvelopeC4, EnvelopeC5, EnvelopeC6, EnvelopeC65, EnvelopeC7, EnvelopeChou3, EnvelopeChou4, EnvelopeDL, EnvelopeInvite, EnvelopeItalian, EnvelopeKaku2, EnvelopeKaku3, EnvelopeMonarch, EnvelopePersonal, EnvelopePrc1, EnvelopePrc10, EnvelopePrc2, EnvelopePrc3, EnvelopePrc4, EnvelopePrc5, EnvelopePrc6, EnvelopePrc7, EnvelopePrc8, EnvelopePrc9, EnvelopeYou4, Executive, ExecutiveStandard, FanFoldGerman, FanFoldGermanLegal, FanFoldUS, Folio, Imperial10x11, Imperial10x13, Imperial10x14, Imperial12x11, Imperial15x11, Imperial7x9, Imperial8x10, Imperial9x11, Imperial9x12, JisB0, JisB1, JisB10, JisB2, JisB3, JisB4, JisB5, JisB6, JisB7, JisB8, JisB9, LastPageSize, Ledger, Legal, LegalExtra, Letter, LetterExtra, LetterPlus, LetterSmall, msgImperialPageSizeInch(), Note, Postcard, Prc16K, Prc32K, Prc32KBig, Quarto, Statement, SuperA, SuperB, Tabloid, TabloidExtra, and QCoreApplication::translate().

+ Here is the call graph for this function:

◆ operator=()

QPageSize & QPageSize::operator= ( const QPageSize & other)

Assignment operator, assigns other to this.

Move-assigns other to this QPageSize instance, transferring the ownership of the managed pointer to this instance.

Definition at line 1202 of file qpagesize.cpp.

References other().

+ Here is the call graph for this function:

◆ rect()

QRectF QPageSize::rect ( Unit units) const

Returns the page rectangle in the required units.

If the QPageSize is invalid then the QRect will be invalid.

Definition at line 1415 of file qpagesize.cpp.

References isValid(), and QPageSizePrivate::size().

+ Here is the call graph for this function:

◆ rectPixels()

QRect QPageSize::rectPixels ( int resolution) const

Returns the page rectangle in Device Pixels at the given resolution.

If the QPageSize is invalid then the QRect will be invalid.

Definition at line 1437 of file qpagesize.cpp.

References isValid(), and QPageSizePrivate::sizePixels().

+ Here is the call graph for this function:

◆ rectPoints()

QRect QPageSize::rectPoints ( ) const

Returns the page rectangle in Postscript Points (1/72 of an inch).

If the QPageSize is invalid then the QRect will be invalid.

Definition at line 1426 of file qpagesize.cpp.

References isValid().

+ Here is the call graph for this function:

◆ size() [1/2]

QSizeF QPageSize::size ( PageSizeId pageSizeId,
Unit units )
static

Returns the size of the standard pageSizeId in the requested units.

Definition at line 1801 of file qpagesize.cpp.

References Custom, and qt_unitSize().

+ Here is the call graph for this function:

◆ size() [2/2]

QSizeF QPageSize::size ( Unit units) const

Returns the size of the page in the required units.

If the QPageSize is invalid then the QSizeF will be invalid.

Definition at line 1382 of file qpagesize.cpp.

References isValid(), and QPageSizePrivate::size().

Referenced by QPrintDialogPrivate::openCocoaPrintPanel(), QWindowsPrintDevice::printableMargins(), QWin32PrintEnginePrivate::setPageSize(), QMacPrintEngine::setProperty(), and QWin32PrintEngine::setProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sizePixels() [1/2]

QSize QPageSize::sizePixels ( int resolution) const

Returns the size of the page in Device Pixels at the given resolution.

If the QPageSize is invalid then the QSize will be invalid.

Definition at line 1404 of file qpagesize.cpp.

References isValid(), and QPageSizePrivate::sizePixels().

Referenced by QPageLayoutPrivate::fullRectPixels().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sizePixels() [2/2]

QSize QPageSize::sizePixels ( PageSizeId pageSizeId,
int resolution )
static

Returns the size of the standard pageSizeId in Device Pixels for the given resolution.

Definition at line 1824 of file qpagesize.cpp.

References Custom, qt_convertPointsToPixels(), and sizePoints().

+ Here is the call graph for this function:

◆ sizePoints() [1/2]

QSize QPageSize::sizePoints ( ) const

Returns the size of the page in Postscript Points (1/72 of an inch).

If the QPageSize is invalid then the QSize will be invalid.

Definition at line 1393 of file qpagesize.cpp.

References isValid().

Referenced by QPageLayoutPrivate::fullRectPoints(), QCocoaPrintDevice::macPaper(), operator<<(), sizePixels(), and QPlatformPrintDevice::supportedPageSizeMatch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sizePoints() [2/2]

QSize QPageSize::sizePoints ( PageSizeId pageSizeId)
static

Returns the size of the standard pageSizeId in Points.

Definition at line 1812 of file qpagesize.cpp.

References Custom, and qt_pageSizes.

◆ swap()

void QPageSize::swap ( QPageSize & other)
inlinenoexcept

Swaps this QPageSize with other.

This function is very fast and never fails.

Definition at line 204 of file qpagesize.h.

References d, and other().

+ Here is the call graph for this function:

◆ windowsId() [1/2]

int QPageSize::windowsId ( ) const

Returns the Windows DMPAPER enum value for the page size.

Not all valid PPD page sizes have a Windows equivalent, in which case 0 will be returned.

If the QPageSize is invalid then the Windows ID will be 0.

See also
id()

Definition at line 1329 of file qpagesize.cpp.

References isValid(), and windowsId().

Referenced by id(), QWindowsPrintDevice::printableMargins(), QWin32PrintEnginePrivate::setPageSize(), and windowsId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ windowsId() [2/2]

int QPageSize::windowsId ( PageSizeId pageSizeId)
static

Returns the Windows DMPAPER enum value of the standard pageSizeId.

Not all valid PPD page sizes have a Windows equivalent, in which case 0 will be returned.

Definition at line 1766 of file qpagesize.cpp.

References qt_pageSizes.

Friends And Related Symbol Documentation

◆ operator!=

bool QPageSize::operator!= ( const QPageSize & lhs,
const QPageSize & rhs )
friend

Returns true if page size lhs is unequal to page size rhs, i.e.

if the page size has different attributes. Current attributes are size and name.

Definition at line 256 of file qpagesize.h.

◆ operator==

bool QPageSize::operator== ( const QPageSize & lhs,
const QPageSize & rhs )
friend

Returns true if page size lhs is equal to page size rhs, i.e.

if the page sizes have the same attributes. Current attributes are size and name.

Definition at line 254 of file qpagesize.h.

◆ QPageSizePrivate

friend class QPageSizePrivate
friend

Definition at line 250 of file qpagesize.h.

◆ QPlatformPrintDevice

friend class QPlatformPrintDevice
friend

Definition at line 251 of file qpagesize.h.


The documentation for this class was generated from the following files: