7#include <QtCore/qpoint.h>
8#include <QtCore/qrect.h>
9#include <QtCore/qsize.h>
45 if (fromUnits == toUnits || xy.
isNull())
61 qRound(pointXy.
y() * 100 / multiplier) / 100.0);
67 if (fromUnits == toUnits || margins.
isNull())
85 qRound(pointMargins.
top() * 100 / multiplier) / 100.0,
86 qRound(pointMargins.
right() * 100 / multiplier) / 100.0,
87 qRound(pointMargins.
bottom() * 100 / multiplier) / 100.0);
145 m_fullSize = fullSizeUnits(m_units);
155 return m_pageSize ==
other.m_pageSize
156 && m_orientation ==
other.m_orientation
157 && m_units ==
other.m_units
158 && m_margins ==
other.m_margins
159 && m_minMargins ==
other.m_minMargins
160 && m_maxMargins ==
other.m_maxMargins;
166 && m_orientation ==
other.m_orientation
201 m_minMargins = minMargins;
476 d->m_fullSize = d->fullSizeUnits(d->m_units);
490 return d->m_pageSize;
505 d->m_fullSize = d->fullSizeUnits(d->m_units);
508 d->m_maxMargins.
setLeft(d->m_maxMargins.
left() + change);
510 d->m_maxMargins.
setTop(d->m_maxMargins.
top() - change);
521 return d->m_orientation;
530 if (
units != d->m_units) {
536 d->m_fullSize = d->fullSizeUnits(d->m_units);
605 || (leftMargin >= d->m_minMargins.
left() && leftMargin <= d->m_maxMargins.left())) {
607 d->m_margins.
setLeft(leftMargin);
632 || (rightMargin >= d->m_minMargins.
right() && rightMargin <= d->m_maxMargins.right())) {
659 || (topMargin >= d->m_minMargins.
top() && topMargin <= d->m_maxMargins.top())) {
661 d->m_margins.
setTop(topMargin);
686 || (bottomMargin >= d->m_minMargins.
bottom() && bottomMargin <= d->m_maxMargins.bottom())) {
765 return d->m_minMargins;
782 return d->m_maxMargins;
870 if (
units == d->m_units)
912#ifndef QT_NO_DEBUG_STREAM
918 dbg <<
"QPageLayout(";
921 dbg <<
'"' <<
layout.pageSize().name() <<
"\", "
void detach()
If the shared data object's reference count is greater than 1, this function creates a deep copy of t...
constexpr qreal right() const noexcept
Returns the right margin.
constexpr qreal left() const noexcept
Returns the left margin.
constexpr qreal top() const noexcept
Returns the top margin.
constexpr void setLeft(qreal aleft) noexcept
Sets the left margin to aleft (which must be finite).
constexpr bool isNull() const noexcept
Returns true if all margins are very close to 0; otherwise returns false.
constexpr QMargins toMargins() const noexcept
Returns an integer-based copy of this margins object.
constexpr void setRight(qreal aright) noexcept
Sets the right margin to aright (which must be finite).
constexpr void setBottom(qreal abottom) noexcept
Sets the bottom margin to abottom (which must be finite).
constexpr void setTop(qreal atop) noexcept
Sets the top margin to atop (which must be finite).
constexpr qreal bottom() const noexcept
Returns the bottom margin.
bool isEquivalentTo(const QPageLayoutPrivate &other) const
bool operator==(const QPageLayoutPrivate &other) const
void setDefaultMargins(const QMarginsF &minMargins)
QMargins marginsPixels(int resolution) const
QRect fullRectPixels(int resolution) const
QRect fullRectPoints() const
QMarginsF margins(QPageLayout::Unit units) const
QPageLayoutPrivate(const QPageSize &pageSize, QPageLayout::Orientation orientation, const QMarginsF &margins, QPageLayout::Unit units, const QMarginsF &minMargins)
void clampMargins(const QMarginsF &margins)
QMargins marginsPoints() const
QRect paintRectPoints() const
Returns the paintable rectangle in rounded Postscript Points (1/72 of an inch).
QMargins marginsPoints() const
Returns the margins of the page layout in Postscript Points (1/72 of an inch).
bool setLeftMargin(qreal leftMargin)
Sets the left page margin of the page layout to leftMargin.
QMarginsF minimumMargins() const
Returns the minimum margins of the page layout.
void setOrientation(Orientation orientation)
Sets the page orientation of the page layout to orientation.
QRect fullRectPoints() const
Returns the full page rectangle in Postscript Points (1/72 of an inch).
bool setBottomMargin(qreal bottomMargin)
Sets the bottom page margin of the page layout to bottomMargin.
Mode mode() const
Returns the page layout mode.
QRectF fullRect() const
Returns the full page rectangle in the current layout units.
bool isEquivalentTo(const QPageLayout &other) const
Returns true if this page layout is equivalent to the other page layout, i.e.
void setMinimumMargins(const QMarginsF &minMargins)
Sets the minimum page margins of the page layout to minMargins.
void setUnits(Unit units)
Sets the units used to define the page layout.
bool setMargins(const QMarginsF &margins)
Sets the page margins of the page layout to margins Returns true if the margins were successfully set...
Unit units() const
Returns the units the page layout is currently defined in.
bool isValid() const
Returns true if this page layout is valid.
QMargins marginsPixels(int resolution) const
Returns the margins of the page layout in device pixels for the given resolution.
bool setRightMargin(qreal rightMargin)
Sets the right page margin of the page layout to rightMargin.
QRectF paintRect() const
Returns the page rectangle in the current layout units.
Unit
This enum type is used to specify the measurement unit for page layout and margins.
bool setTopMargin(qreal topMargin)
Sets the top page margin of the page layout to topMargin.
QPageLayout()
Creates an invalid QPageLayout.
QMarginsF margins() const
Returns the margins of the page layout using the currently set units.
Mode
Defines the page layout mode.
QPageLayout & operator=(const QPageLayout &other)
Assignment operator, assigns other to this.
Orientation orientation() const
Returns the page orientation of the page layout.
~QPageLayout()
Destroys the page layout.
QMarginsF maximumMargins() const
Returns the maximum margins that would be applied if the page layout was in StandardMode.
QRect paintRectPixels(int resolution) const
Returns the paintable rectangle in rounded device pixels for the given resolution.
void setPageSize(const QPageSize &pageSize, const QMarginsF &minMargins=QMarginsF(0, 0, 0, 0))
Sets the page size of the page layout to pageSize.
Orientation
This enum type defines the page orientation.
QRect fullRectPixels(int resolution) const
Returns the full page rectangle in device pixels for the given resolution.
void setMode(Mode mode)
Sets a page layout mode to mode.
QPageSize pageSize() const
Returns the page size of the page layout.
bool isValid() const
Returns true if this page size is valid.
Unit
This enum type is used to specify the measurement unit for page sizes.
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.
bool isEquivalentTo(const QPageSize &other) const
Returns true if this page is equivalent to the other page, i.e.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns fa...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr qreal width() const noexcept
Returns the width.
constexpr QSizeF transposed() const noexcept
constexpr qreal height() const noexcept
Returns the height.
constexpr QSize transposed() const noexcept
Combined button and popup list for selecting options.
int qRound(qfloat16 d) noexcept
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
QPointF qt_convertPoint(const QPointF &xy, QPageLayout::Unit fromUnits, QPageLayout::Unit toUnits)
Q_GUI_EXPORT QMarginsF qt_convertMargins(const QMarginsF &margins, QPageLayout::Unit fromUnits, QPageLayout::Unit toUnits)
qreal qt_pixelMultiplier(int resolution)
QDebug operator<<(QDebug dbg, const QPageLayout &layout)
QT_BEGIN_NAMESPACE Q_GUI_EXPORT qreal qt_pointMultiplier(QPageLayout::Unit unit)