43 #include <QtCore/qpoint.h>
44 #include <QtCore/qrect.h>
45 #include <QtCore/qsize.h>
77 if (fromUnits == toUnits || xy.
isNull())
93 qRound(pointXy.
y() * 100 / multiplier) / 100.0);
99 if (fromUnits == toUnits || margins.
isNull())
117 qRound(pointMargins.
top() * 100 / multiplier) / 100.0,
118 qRound(pointMargins.
right() * 100 / multiplier) / 100.0,
119 qRound(pointMargins.
bottom() * 100 / multiplier) / 100.0);
177 m_fullSize = fullSizeUnits(m_units);
187 return m_pageSize ==
other.m_pageSize
188 && m_orientation ==
other.m_orientation
189 && m_units ==
other.m_units
190 && m_margins ==
other.m_margins
191 && m_minMargins ==
other.m_minMargins
192 && m_maxMargins ==
other.m_maxMargins;
198 && m_orientation ==
other.m_orientation
233 m_minMargins = minMargins;
508 d->m_fullSize = d->fullSizeUnits(d->m_units);
522 return d->m_pageSize;
537 d->m_fullSize = d->fullSizeUnits(d->m_units);
540 d->m_maxMargins.
setLeft(d->m_maxMargins.
left() + change);
542 d->m_maxMargins.
setTop(d->m_maxMargins.
top() - change);
553 return d->m_orientation;
562 if (
units != d->m_units) {
568 d->m_fullSize = d->fullSizeUnits(d->m_units);
637 || (leftMargin >= d->m_minMargins.
left() && leftMargin <= d->m_maxMargins.left())) {
639 d->m_margins.
setLeft(leftMargin);
664 || (rightMargin >= d->m_minMargins.
right() && rightMargin <= d->m_maxMargins.right())) {
691 || (topMargin >= d->m_minMargins.
top() && topMargin <= d->m_maxMargins.top())) {
693 d->m_margins.
setTop(topMargin);
718 || (bottomMargin >= d->m_minMargins.
bottom() && bottomMargin <= d->m_maxMargins.bottom())) {
797 return d->m_minMargins;
814 return d->m_maxMargins;
902 if (
units == d->m_units)
944 #ifndef QT_NO_DEBUG_STREAM
950 dbg <<
"QPageLayout(";
953 dbg <<
'"' <<
layout.pageSize().name() <<
"\", "
operator<<(QDataStream &ds, qfloat16 f)
The QDebug class provides an output stream for debugging information.
Convenience class for custom QDebug operators.
The QMarginsF class defines the four margins of a rectangle.
constexpr qreal right() const noexcept
constexpr qreal left() const noexcept
constexpr qreal top() const noexcept
constexpr void setLeft(qreal aleft) noexcept
constexpr bool isNull() const noexcept
constexpr QMargins toMargins() const noexcept
constexpr void setRight(qreal aright) noexcept
constexpr void setBottom(qreal abottom) noexcept
constexpr void setTop(qreal atop) noexcept
constexpr qreal bottom() const noexcept
The QMargins class defines the four margins of a rectangle.
Describes the size, orientation and margins of a page.
QRect paintRectPoints() const
QMargins marginsPoints() const
bool setLeftMargin(qreal leftMargin)
QMarginsF minimumMargins() const
void setOrientation(Orientation orientation)
QRect fullRectPoints() const
bool setBottomMargin(qreal bottomMargin)
bool isEquivalentTo(const QPageLayout &other) const
void setMinimumMargins(const QMarginsF &minMargins)
void setUnits(Unit units)
bool setMargins(const QMarginsF &margins)
QMargins marginsPixels(int resolution) const
bool setRightMargin(qreal rightMargin)
bool setTopMargin(qreal topMargin)
QMarginsF margins() const
QPageLayout & operator=(const QPageLayout &other)
Orientation orientation() const
QMarginsF maximumMargins() const
QRect paintRectPixels(int resolution) const
void setPageSize(const QPageSize &pageSize, const QMarginsF &minMargins=QMarginsF(0, 0, 0, 0))
QRect fullRectPixels(int resolution) const
QPageSize pageSize() const
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
The QPageSize class describes the size and name of a defined page size.
QSizeF size(Unit units) const
QSize sizePixels(int resolution) const
bool isEquivalentTo(const QPageSize &other) const
The QPointF class defines a point in the plane using floating point precision.
constexpr qreal x() const noexcept
constexpr qreal y() const noexcept
bool isNull() const noexcept
The QPoint class defines a point in the plane using integer precision.
The QRectF class defines a finite rectangle in the plane using floating point precision.
The QRect class defines a rectangle in the plane using integer precision.
The QSharedData class is a base class for shared data objects. \reentrant.
The QSizeF class defines the size of a two-dimensional object using floating point precision.
constexpr qreal width() const noexcept
constexpr QSizeF transposed() const noexcept
constexpr qreal height() const noexcept
constexpr QSize transposed() const noexcept
png_const_structrp png_const_inforp int * unit
int qRound(qfloat16 d) noexcept
QT_END_INCLUDE_NAMESPACE typedef double qreal
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)
QT_BEGIN_NAMESPACE Q_GUI_EXPORT qreal qt_pointMultiplier(QPageLayout::Unit unit)