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
QPageLayout Class Reference

\inmodule QtGui More...

#include <qpagelayout.h>

+ Collaboration diagram for QPageLayout:

Public Types

enum  Unit {
  Millimeter , Point , Inch , Pica ,
  Didot , Cicero
}
 This enum type is used to specify the measurement unit for page layout and margins. More...
 
enum  Orientation { Portrait , Landscape }
 This enum type defines the page orientation. More...
 
enum  Mode { StandardMode , FullPageMode }
 Defines the page layout mode. More...
 
enum class  OutOfBoundsPolicy { Reject , Clamp }
 

Public Member Functions

 QPageLayout ()
 Creates an invalid QPageLayout.
 
 QPageLayout (const QPageSize &pageSize, Orientation orientation, const QMarginsF &margins, Unit units=Point, const QMarginsF &minMargins=QMarginsF(0, 0, 0, 0))
 Creates a QPageLayout with the given pageSize, orientation and margins in the given units.
 
 QPageLayout (const QPageLayout &other)
 Copy constructor, copies other to this.
 
QPageLayoutoperator= (const QPageLayout &other)
 Assignment operator, assigns other to this.
 
 ~QPageLayout ()
 Destroys the page layout.
 
void swap (QPageLayout &other) noexcept
 Swaps this page layout with other.
 
bool isEquivalentTo (const QPageLayout &other) const
 Returns true if this page layout is equivalent to the other page layout, i.e.
 
bool isValid () const
 Returns true if this page layout is valid.
 
void setMode (Mode mode)
 Sets a page layout mode to mode.
 
Mode mode () const
 Returns the page layout mode.
 
void setPageSize (const QPageSize &pageSize, const QMarginsF &minMargins=QMarginsF(0, 0, 0, 0))
 Sets the page size of the page layout to pageSize.
 
QPageSize pageSize () const
 Returns the page size of the page layout.
 
void setOrientation (Orientation orientation)
 Sets the page orientation of the page layout to orientation.
 
Orientation orientation () const
 Returns the page orientation of the page layout.
 
void setUnits (Unit units)
 Sets the units used to define the page layout.
 
Unit units () const
 Returns the units the page layout is currently defined in.
 
bool setMargins (const QMarginsF &margins, OutOfBoundsPolicy outOfBoundsPolicy=OutOfBoundsPolicy::Reject)
 Sets the page margins of the page layout to margins.
 
bool setLeftMargin (qreal leftMargin, OutOfBoundsPolicy outOfBoundsPolicy=OutOfBoundsPolicy::Reject)
 Sets the left page margin of the page layout to leftMargin.
 
bool setRightMargin (qreal rightMargin, OutOfBoundsPolicy outOfBoundsPolicy=OutOfBoundsPolicy::Reject)
 Sets the right page margin of the page layout to rightMargin.
 
bool setTopMargin (qreal topMargin, OutOfBoundsPolicy outOfBoundsPolicy=OutOfBoundsPolicy::Reject)
 Sets the top page margin of the page layout to topMargin.
 
bool setBottomMargin (qreal bottomMargin, OutOfBoundsPolicy outOfBoundsPolicy=OutOfBoundsPolicy::Reject)
 Sets the bottom page margin of the page layout to bottomMargin.
 
QMarginsF margins () const
 Returns the margins of the page layout using the currently set units.
 
QMarginsF margins (Unit units) const
 Returns the margins of the page layout using the requested units.
 
QMargins marginsPoints () const
 Returns the margins of the page layout in Postscript Points (1/72 of an inch).
 
QMargins marginsPixels (int resolution) const
 Returns the margins of the page layout in device pixels for the given resolution.
 
void setMinimumMargins (const QMarginsF &minMargins)
 Sets the minimum page margins of the page layout to minMargins.
 
QMarginsF minimumMargins () const
 Returns the minimum margins of the page layout.
 
QMarginsF maximumMargins () const
 Returns the maximum margins that would be applied if the page layout was in StandardMode.
 
QRectF fullRect () const
 Returns the full page rectangle in the current layout units.
 
QRectF fullRect (Unit units) const
 Returns the full page rectangle in the required units.
 
QRect fullRectPoints () const
 Returns the full page rectangle in Postscript Points (1/72 of an inch).
 
QRect fullRectPixels (int resolution) const
 Returns the full page rectangle in device pixels for the given resolution.
 
QRectF paintRect () const
 Returns the page rectangle in the current layout units.
 
QRectF paintRect (Unit units) const
 Returns the page rectangle in the required units.
 
QRect paintRectPoints () const
 Returns the paintable rectangle in rounded Postscript Points (1/72 of an inch).
 
QRect paintRectPixels (int resolution) const
 Returns the paintable rectangle in rounded device pixels for the given resolution.
 

Friends

class QPageLayoutPrivate
 
bool operator== (const QPageLayout &lhs, const QPageLayout &rhs)
 Returns true if page layout lhs is equal to page layout rhs, i.e.
 
bool operator!= (const QPageLayout &lhs, const QPageLayout &rhs)
 Returns true if page layout lhs is not equal to page layout rhs, i.e.
 

Detailed Description

\inmodule QtGui

Since
5.3

Describes the size, orientation and margins of a page.

The QPageLayout class defines the layout of a page in a paged document, with the page size, orientation and margins able to be set and the full page and paintable page rectangles defined by those attributes able to be queried in a variety of units.

The page size is defined by the QPageSize class which can be queried for page size attributes. Note that the QPageSize itself is always defined in a Portrait orientation.

The minimum margins can be defined for the layout but normally default to 0. When used in conjunction with Qt's printing support the minimum margins will reflect the minimum printable area defined by the printer.

In the default StandardMode the current margins and minimum margins are always taken into account. The paintable rectangle is the full page rectangle less the current margins, and the current margins can only be set to values between the minimum margins and the maximum margins allowed by the full page size.

In FullPageMode the current margins and minimum margins are not taken into account. The paintable rectangle is the full page rectangle, and the current margins can be set to any values regardless of the minimum margins and page size.

See also
QPageSize

Definition at line 19 of file qpagelayout.h.

Member Enumeration Documentation

◆ Mode

Defines the page layout mode.

\value StandardMode Paint Rect includes margins, margins must fall between the minimum and maximum. \value FullPageMode Paint Rect excludes margins, margins can be any value and must be managed manually.

In StandardMode, when setting margins, use \l{QPageLayout::OutOfBoundsPolicy::}{Clamp} to automatically clamp the margins to fall between the minimum and maximum allowed values.

See also
OutOfBoundsPolicy
Enumerator
StandardMode 
FullPageMode 

Definition at line 38 of file qpagelayout.h.

◆ Orientation

This enum type defines the page orientation.

\value Portrait The page size is used in its default orientation \value Landscape The page size is rotated through 90 degrees

Note that some standard page sizes are defined with a width larger than their height, hence the orientation is defined relative to the standard page size and not using the relative page dimensions.

Enumerator
Portrait 
Landscape 

Definition at line 33 of file qpagelayout.h.

◆ OutOfBoundsPolicy

enum class QPageLayout::OutOfBoundsPolicy
strong
Since
6.8

Defines the policy for margins that are out of bounds

\value Reject The margins must fall within the minimum and maximum values, otherwise they will be rejected. \value Clamp The margins are clamped between the minimum and maximum values to ensure they are valid.

Note
The policy has no effect in \l{QPageLayout::Mode}{FullPageMode}, where all margins are accepted.
Enumerator
Reject 
Clamp 

Definition at line 43 of file qpagelayout.h.

◆ Unit

This enum type is used to specify the measurement unit for page layout and margins.

\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 24 of file qpagelayout.h.

Constructor & Destructor Documentation

◆ QPageLayout() [1/3]

QPageLayout::QPageLayout ( )

Creates an invalid QPageLayout.

Definition at line 318 of file qpagelayout.cpp.

◆ QPageLayout() [2/3]

QPageLayout::QPageLayout ( const QPageSize & pageSize,
Orientation orientation,
const QMarginsF & margins,
Unit units = Point,
const QMarginsF & minMargins = QMarginsF(0, 0, 0, 0) )

Creates a QPageLayout with the given pageSize, orientation and margins in the given units.

Optionally define the minimum allowed margins minMargins, e.g. the minimum margins able to be printed by a physical print device.

The constructed QPageLayout will be in StandardMode.

The margins given will be clamped to the minimum margins and the maximum margins allowed by the page size.

Definition at line 336 of file qpagelayout.cpp.

◆ QPageLayout() [3/3]

QPageLayout::QPageLayout ( const QPageLayout & other)

Copy constructor, copies other to this.

Definition at line 347 of file qpagelayout.cpp.

◆ ~QPageLayout()

QPageLayout::~QPageLayout ( )

Destroys the page layout.

Definition at line 356 of file qpagelayout.cpp.

Member Function Documentation

◆ fullRect() [1/2]

QRectF QPageLayout::fullRect ( ) const

Returns the full page rectangle in the current layout units.

The page rectangle takes into account the page size and page orientation, but not the page margins.

See also
paintRect(), units()

Definition at line 822 of file qpagelayout.cpp.

References QPageLayoutPrivate::fullRect(), and isValid().

Referenced by QPrinter::paperRect().

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

◆ fullRect() [2/2]

QRectF QPageLayout::fullRect ( Unit units) const

Returns the full page rectangle in the required units.

The page rectangle takes into account the page size and page orientation, but not the page margins.

See also
paintRect()

Definition at line 836 of file qpagelayout.cpp.

References QPageLayoutPrivate::fullRect(), and isValid().

+ Here is the call graph for this function:

◆ fullRectPixels()

QRect QPageLayout::fullRectPixels ( int resolution) const

Returns the full page rectangle in device pixels for the given resolution.

The page rectangle takes into account the page size and page orientation, but not the page margins.

See also
paintRect()

Definition at line 864 of file qpagelayout.cpp.

References QPageLayoutPrivate::fullRectPixels(), and isValid().

Referenced by QMacPrintEnginePrivate::newPage_helper(), QPrinter::paperRect(), QPrintPreviewWidgetPrivate::populateScene(), and QWin32PrintEnginePrivate::updateMetrics().

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

◆ fullRectPoints()

QRect QPageLayout::fullRectPoints ( ) const

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

The page rectangle takes into account the page size and page orientation, but not the page margins.

See also
paintRect()

Definition at line 850 of file qpagelayout.cpp.

References QPageLayoutPrivate::fullRectPoints(), and isValid().

Referenced by QPdfEnginePrivate::newPage(), QPdfEnginePrivate::pageMatrix(), and QPagePreview::paintEvent().

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

◆ isEquivalentTo()

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

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

if the page has the same size, margins and orientation.

Definition at line 424 of file qpagelayout.cpp.

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

Referenced by QPdfPagedPaintDevicePrivate::setPageLayout(), and QPrinterPagedPaintDevicePrivate::setPageLayout().

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

◆ isValid()

bool QPageLayout::isValid ( ) const

Returns true if this page layout is valid.

Definition at line 433 of file qpagelayout.cpp.

References QPageLayoutPrivate::isValid().

Referenced by fullRect(), fullRect(), fullRectPixels(), fullRectPoints(), paintRect(), paintRect(), paintRectPixels(), paintRectPoints(), QMacPrintEngine::setProperty(), QCupsPrintEngine::setProperty(), QPdfPrintEngine::setProperty(), and QWin32PrintEngine::setProperty().

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

◆ margins() [1/2]

QMarginsF QPageLayout::margins ( ) const

Returns the margins of the page layout using the currently set units.

See also
setMargins(), units()

Definition at line 728 of file qpagelayout.cpp.

Referenced by operator<<(), QPagePreview::paintEvent(), QTextDocument::print(), setMargins(), QPdfPagedPaintDevicePrivate::setPageMargins(), QPrinterPagedPaintDevicePrivate::setPageMargins(), QMacPrintEngine::setProperty(), QWin32PrintEngine::setProperty(), and QWin32PrintEnginePrivate::updateMetrics().

+ Here is the caller graph for this function:

◆ margins() [2/2]

QMarginsF QPageLayout::margins ( Unit units) const

Returns the margins of the page layout using the requested units.

See also
setMargins(), margins()

Definition at line 739 of file qpagelayout.cpp.

References QPageLayoutPrivate::margins().

+ Here is the call graph for this function:

◆ marginsPixels()

QMargins QPageLayout::marginsPixels ( int resolution) const

Returns the margins of the page layout in device pixels for the given resolution.

See also
setMargins()

Definition at line 761 of file qpagelayout.cpp.

References QPageLayoutPrivate::marginsPixels().

+ Here is the call graph for this function:

◆ marginsPoints()

QMargins QPageLayout::marginsPoints ( ) const

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

See also
setMargins(), margins()

Definition at line 750 of file qpagelayout.cpp.

References QPageLayoutPrivate::marginsPoints(), and QMarginsF::toMargins().

+ Here is the call graph for this function:

◆ maximumMargins()

QMarginsF QPageLayout::maximumMargins ( ) const

Returns the maximum margins that would be applied if the page layout was in StandardMode.

The maximum margins allowed are calculated as the full size of the page minus the minimum margins set. For example, if the page width is 100 points and the minimum right margin is 10 points, then the maximum left margin will be 90 points.

See also
setMinimumMargins(), minimumMargins()

Definition at line 808 of file qpagelayout.cpp.

◆ minimumMargins()

QMarginsF QPageLayout::minimumMargins ( ) const

Returns the minimum margins of the page layout.

See also
setMinimumMargins(), maximumMargins()

Definition at line 791 of file qpagelayout.cpp.

◆ mode()

QPageLayout::Mode QPageLayout::mode ( ) const

Returns the page layout mode.

Definition at line 452 of file qpagelayout.cpp.

Referenced by QMacPrintEnginePrivate::newPage_helper(), QPdfEnginePrivate::pageMatrix(), setMode(), QMacPrintEngine::setProperty(), QWin32PrintEngine::setProperty(), and QWin32PrintEnginePrivate::updateMetrics().

+ Here is the caller graph for this function:

◆ operator=()

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

Assignment operator, assigns other to this.

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

Definition at line 364 of file qpagelayout.cpp.

References other().

+ Here is the call graph for this function:

◆ orientation()

◆ pageSize()

QPageSize QPageLayout::pageSize ( ) const

Returns the page size of the page layout.

Note that the QPageSize is always defined in a Portrait orientation. To obtain a size that takes the set orientation into account you must use fullRect().

Definition at line 487 of file qpagelayout.cpp.

Referenced by QCupsPrintEnginePrivate::closePrintDevice(), QMacPrintEnginePrivate::initialize(), QPrintDialogPrivate::openCocoaPrintPanel(), QWin32PrintEnginePrivate::setPageSize(), QPdfPagedPaintDevicePrivate::setPageSize(), QPrinterPagedPaintDevicePrivate::setPageSize(), setPageSize(), QMacPrintEngine::setProperty(), QCupsPrintEngine::setProperty(), and QWin32PrintEngine::setProperty().

+ Here is the caller graph for this function:

◆ paintRect() [1/2]

QRectF QPageLayout::paintRect ( ) const

Returns the page rectangle in the current layout units.

The paintable rectangle takes into account the page size, orientation and margins.

If the FullPageMode mode is set then the fullRect() is returned and the margins must be manually managed.

Definition at line 879 of file qpagelayout.cpp.

References isValid(), and QPageLayoutPrivate::paintRect().

Referenced by QPrinter::pageRect(), and QWin32PrintEnginePrivate::updateMetrics().

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

◆ paintRect() [2/2]

QRectF QPageLayout::paintRect ( Unit units) const

Returns the page rectangle in the required units.

The paintable rectangle takes into account the page size, orientation and margins.

If the FullPageMode mode is set then the fullRect() is returned and the margins must be manually managed.

Definition at line 894 of file qpagelayout.cpp.

References FullPageMode, QPageLayoutPrivate::fullRect(), isValid(), QPageLayoutPrivate::margins(), and QPageLayoutPrivate::paintRect().

+ Here is the call graph for this function:

◆ paintRectPixels()

QRect QPageLayout::paintRectPixels ( int resolution) const

Returns the paintable rectangle in rounded device pixels for the given resolution.

The paintable rectangle takes into account the page size, orientation and margins.

If the FullPageMode mode is set then the fullRect() is returned and the margins must be manually managed.

Definition at line 932 of file qpagelayout.cpp.

References FullPageMode, QPageLayoutPrivate::fullRectPixels(), isValid(), and QPageLayoutPrivate::marginsPixels().

Referenced by QMacPrintEnginePrivate::newPage_helper(), QPdfEnginePrivate::pageMatrix(), QPrinter::pageRect(), QPrintPreviewWidgetPrivate::populateScene(), and QWin32PrintEnginePrivate::updateMetrics().

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

◆ paintRectPoints()

QRect QPageLayout::paintRectPoints ( ) const

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

The paintable rectangle takes into account the page size, orientation and margins.

If the FullPageMode mode is set then the fullRect() is returned and the margins must be manually managed.

Definition at line 914 of file qpagelayout.cpp.

References FullPageMode, QPageLayoutPrivate::fullRectPoints(), isValid(), QPageLayoutPrivate::marginsPoints(), and QMarginsF::toMargins().

+ Here is the call graph for this function:

◆ setBottomMargin()

bool QPageLayout::setBottomMargin ( qreal bottomMargin,
OutOfBoundsPolicy outOfBoundsPolicy = OutOfBoundsPolicy::Reject )

Sets the bottom page margin of the page layout to bottomMargin.

Returns true if the margin was successfully set.

The units used are those currently defined for the layout. To use different units call setUnits() first.

Since Qt 6.8, the optional outOfBoundsPolicy can be used to specify how margins that are out of bounds are handled.

See also
setMargins(), margins()

Definition at line 704 of file qpagelayout.cpp.

References QMarginsF::bottom(), Clamp, QExplicitlySharedDataPointer< T >::detach(), FullPageMode, qBound(), qFuzzyCompare(), QMarginsF::setBottom(), and StandardMode.

+ Here is the call graph for this function:

◆ setLeftMargin()

bool QPageLayout::setLeftMargin ( qreal leftMargin,
OutOfBoundsPolicy outOfBoundsPolicy = OutOfBoundsPolicy::Reject )

Sets the left page margin of the page layout to leftMargin.

Returns true if the margin was successfully set.

The units used are those currently defined for the layout. To use different units call setUnits() first.

Since Qt 6.8, the optional outOfBoundsPolicy can be used to specify how margins that are out of bounds are handled.

See also
setMargins(), margins()

Definition at line 611 of file qpagelayout.cpp.

References Clamp, QExplicitlySharedDataPointer< T >::detach(), FullPageMode, QMarginsF::left(), qBound(), qFuzzyCompare(), QMarginsF::setLeft(), and StandardMode.

+ Here is the call graph for this function:

◆ setMargins()

bool QPageLayout::setMargins ( const QMarginsF & margins,
OutOfBoundsPolicy outOfBoundsPolicy = OutOfBoundsPolicy::Reject )

Sets the page margins of the page layout to margins.

Returns true if the margins were successfully set.

The units used are those currently defined for the layout. To use different units then call setUnits() first.

Since Qt 6.8, the optional outOfBoundsPolicy can be used to specify how margins that are out of bounds are handled.

See also
margins(), units()

Definition at line 561 of file qpagelayout.cpp.

References QMarginsF::bottom(), Clamp, QPageLayoutPrivate::clampMargins(), QExplicitlySharedDataPointer< T >::detach(), FullPageMode, QMarginsF::left(), margins(), QMarginsF::right(), and QMarginsF::top().

+ Here is the call graph for this function:

◆ setMinimumMargins()

void QPageLayout::setMinimumMargins ( const QMarginsF & minMargins)

Sets the minimum page margins of the page layout to minMargins.

It is not recommended to override the default values set for a page size as this may be the minimum printable area for a physical print device.

If the StandardMode mode is set then the existing margins will be clamped to the new minMargins and the maximum allowed by the page size. If the FullPageMode is set then the existing margins will be unchanged.

See also
minimumMargins(), setMargins()

Definition at line 779 of file qpagelayout.cpp.

References QExplicitlySharedDataPointer< T >::detach(), and QPageLayoutPrivate::setDefaultMargins().

+ Here is the call graph for this function:

◆ setMode()

void QPageLayout::setMode ( Mode mode)

Sets a page layout mode to mode.

Definition at line 442 of file qpagelayout.cpp.

References QExplicitlySharedDataPointer< T >::detach(), and mode().

+ Here is the call graph for this function:

◆ setOrientation()

void QPageLayout::setOrientation ( Orientation orientation)

Sets the page orientation of the page layout to orientation.

Changing the orientation does not affect the current margins or the minimum margins.

Definition at line 499 of file qpagelayout.cpp.

References QMarginsF::bottom(), QExplicitlySharedDataPointer< T >::detach(), QSizeF::height(), QMarginsF::left(), orientation(), QMarginsF::right(), QMarginsF::setBottom(), QMarginsF::setLeft(), QMarginsF::setRight(), QMarginsF::setTop(), QMarginsF::top(), and QSizeF::width().

Referenced by QWin32PrintEnginePrivate::updatePageLayout().

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

◆ setPageSize()

void QPageLayout::setPageSize ( const QPageSize & pageSize,
const QMarginsF & minMargins = QMarginsF(0, 0, 0, 0) )

Sets the page size of the page layout to pageSize.

Optionally define the minimum allowed margins minMargins, e.g. the minimum margins able to be printed by a physical print device, otherwise the minimum margins will default to 0.

If StandardMode is set then the existing margins will be clamped to the new minimum margins and the maximum margins allowed by the page size. If FullPageMode is set then the existing margins will be unchanged.

Definition at line 469 of file qpagelayout.cpp.

References QExplicitlySharedDataPointer< T >::detach(), QPageSize::isValid(), pageSize(), and QPageLayoutPrivate::setDefaultMargins().

Referenced by QMacPrintEnginePrivate::setPageSize(), QWin32PrintEnginePrivate::setPageSize(), and QCupsPrintEngine::setProperty().

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

◆ setRightMargin()

bool QPageLayout::setRightMargin ( qreal rightMargin,
OutOfBoundsPolicy outOfBoundsPolicy = OutOfBoundsPolicy::Reject )

Sets the right page margin of the page layout to rightMargin.

Returns true if the margin was successfully set.

The units used are those currently defined for the layout. To use different units call setUnits() first.

Since Qt 6.8, the optional outOfBoundsPolicy can be used to specify how margins that are out of bounds are handled.

See also
setMargins(), margins()

Definition at line 642 of file qpagelayout.cpp.

References Clamp, QExplicitlySharedDataPointer< T >::detach(), FullPageMode, qBound(), qFuzzyCompare(), QMarginsF::right(), QMarginsF::setRight(), and StandardMode.

+ Here is the call graph for this function:

◆ setTopMargin()

bool QPageLayout::setTopMargin ( qreal topMargin,
OutOfBoundsPolicy outOfBoundsPolicy = OutOfBoundsPolicy::Reject )

Sets the top page margin of the page layout to topMargin.

Returns true if the margin was successfully set.

The units used are those currently defined for the layout. To use different units call setUnits() first.

Since Qt 6.8, the optional outOfBoundsPolicy can be used to specify how margins that are out of bounds are handled.

See also
setMargins(), margins()

Definition at line 673 of file qpagelayout.cpp.

References Clamp, QExplicitlySharedDataPointer< T >::detach(), FullPageMode, qBound(), qFuzzyCompare(), QMarginsF::setTop(), StandardMode, and QMarginsF::top().

+ Here is the call graph for this function:

◆ setUnits()

void QPageLayout::setUnits ( Unit units)

Sets the units used to define the page layout.

Definition at line 527 of file qpagelayout.cpp.

References QExplicitlySharedDataPointer< T >::detach(), qt_convertMargins(), and units().

Referenced by QPageSetupWidget::setPrinter().

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

◆ swap()

void QPageLayout::swap ( QPageLayout & other)
inlinenoexcept

Swaps this page layout with other.

This function is very fast and never fails.

Definition at line 57 of file qpagelayout.h.

References d, and other().

+ Here is the call graph for this function:

◆ units()

QPageLayout::Unit QPageLayout::units ( ) const

Returns the units the page layout is currently defined in.

Definition at line 543 of file qpagelayout.cpp.

Referenced by QPdfPagedPaintDevicePrivate::setPageMargins(), QPrinterPagedPaintDevicePrivate::setPageMargins(), QMacPrintEnginePrivate::setPageSize(), QWin32PrintEnginePrivate::setPageSize(), QPageSetupWidget::setPrinter(), QMacPrintEngine::setProperty(), QWin32PrintEngine::setProperty(), and setUnits().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

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

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

if any of the attributes differ.

Note that this is a strict equality, especially for page size where the QPageSize ID, name and size must exactly match, and the margins where the units must match.

See also
QPageLayout::isEquivalentTo()

Definition at line 115 of file qpagelayout.h.

◆ operator==

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

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

if all the attributes are exactly equal.

Note that this is a strict equality, especially for page size where the QPageSize ID, name and size must exactly match, and the margins where the units must match.

See also
QPageLayout::isEquivalentTo()

Definition at line 113 of file qpagelayout.h.

◆ QPageLayoutPrivate

friend class QPageLayoutPrivate
friend

Definition at line 110 of file qpagelayout.h.


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