Struct qt_gui::QPageLayout

source ·
#[repr(C)]
pub struct QPageLayout { /* private fields */ }
Expand description

Describes the size, orientation and margins of a page.

C++ class: QPageLayout.

C++ documentation:

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.

Implementations§

source§

impl QPageLayout

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QPageLayout>> ) -> Ref<QPageLayout>

Assignment operator, assigns other to this.

Calls C++ function: QPageLayout& QPageLayout::operator=(const QPageLayout& other).

C++ documentation:

Assignment operator, assigns other to this.

source

pub unsafe fn full_rect_0a(&self) -> CppBox<QRectF>

Returns the full page rectangle in the current layout units.

Calls C++ function: QRectF QPageLayout::fullRect() const.

C++ documentation:

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() and units().

source

pub unsafe fn full_rect_1a(&self, units: Unit) -> CppBox<QRectF>

Returns the full page rectangle in the required units.

Calls C++ function: QRectF QPageLayout::fullRect(QPageLayout::Unit units) const.

C++ documentation:

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().

source

pub unsafe fn full_rect_pixels(&self, resolution: c_int) -> CppBox<QRect>

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

Calls C++ function: QRect QPageLayout::fullRectPixels(int resolution) const.

C++ documentation:

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().

source

pub unsafe fn full_rect_points(&self) -> CppBox<QRect>

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

Calls C++ function: QRect QPageLayout::fullRectPoints() const.

C++ documentation:

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().

source

pub unsafe fn is_equivalent_to( &self, other: impl CastInto<Ref<QPageLayout>> ) -> bool

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.

Calls C++ function: bool QPageLayout::isEquivalentTo(const QPageLayout& other) const.

C++ documentation:

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.

source

pub unsafe fn is_valid(&self) -> bool

Returns true if this page layout is valid.

Calls C++ function: bool QPageLayout::isValid() const.

C++ documentation:

Returns true if this page layout is valid.

source

pub unsafe fn margins_0a(&self) -> CppBox<QMarginsF>

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

Calls C++ function: QMarginsF QPageLayout::margins() const.

C++ documentation:

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

See also setMargins() and units().

source

pub unsafe fn margins_1a(&self, units: Unit) -> CppBox<QMarginsF>

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

Calls C++ function: QMarginsF QPageLayout::margins(QPageLayout::Unit units) const.

C++ documentation:

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

See also setMargins() and margins().

source

pub unsafe fn margins_pixels(&self, resolution: c_int) -> CppBox<QMargins>

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

Calls C++ function: QMargins QPageLayout::marginsPixels(int resolution) const.

C++ documentation:

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

See also setMargins().

source

pub unsafe fn margins_points(&self) -> CppBox<QMargins>

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

Calls C++ function: QMargins QPageLayout::marginsPoints() const.

C++ documentation:

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

See also setMargins() and margins().

source

pub unsafe fn maximum_margins(&self) -> CppBox<QMarginsF>

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

Calls C++ function: QMarginsF QPageLayout::maximumMargins() const.

C++ documentation:

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() and minimumMargins().

source

pub unsafe fn minimum_margins(&self) -> CppBox<QMarginsF>

Returns the minimum margins of the page layout.

Calls C++ function: QMarginsF QPageLayout::minimumMargins() const.

C++ documentation:

Returns the minimum margins of the page layout.

See also setMinimumMargins() and maximumMargins().

source

pub unsafe fn mode(&self) -> Mode

Returns the page layout mode.

Calls C++ function: QPageLayout::Mode QPageLayout::mode() const.

C++ documentation:

Returns the page layout mode.

See also setMode().

source

pub unsafe fn new_0a() -> CppBox<QPageLayout>

Creates an invalid QPageLayout.

Calls C++ function: [constructor] void QPageLayout::QPageLayout().

C++ documentation:

Creates an invalid QPageLayout.

source

pub unsafe fn new_5a( page_size: impl CastInto<Ref<QPageSize>>, orientation: Orientation, margins: impl CastInto<Ref<QMarginsF>>, units: Unit, min_margins: impl CastInto<Ref<QMarginsF>> ) -> CppBox<QPageLayout>

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

Calls C++ function: [constructor] void QPageLayout::QPageLayout(const QPageSize& pageSize, QPageLayout::Orientation orientation, const QMarginsF& margins, QPageLayout::Unit units = …, const QMarginsF& minMargins = …).

C++ documentation:

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.

source

pub unsafe fn new_4a( page_size: impl CastInto<Ref<QPageSize>>, orientation: Orientation, margins: impl CastInto<Ref<QMarginsF>>, units: Unit ) -> CppBox<QPageLayout>

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

Calls C++ function: [constructor] void QPageLayout::QPageLayout(const QPageSize& pageSize, QPageLayout::Orientation orientation, const QMarginsF& margins, QPageLayout::Unit units = …).

C++ documentation:

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.

source

pub unsafe fn new_3a( page_size: impl CastInto<Ref<QPageSize>>, orientation: Orientation, margins: impl CastInto<Ref<QMarginsF>> ) -> CppBox<QPageLayout>

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

Calls C++ function: [constructor] void QPageLayout::QPageLayout(const QPageSize& pageSize, QPageLayout::Orientation orientation, const QMarginsF& margins).

C++ documentation:

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.

source

pub unsafe fn new_copy( other: impl CastInto<Ref<QPageLayout>> ) -> CppBox<QPageLayout>

Copy constructor, copies other to this.

Calls C++ function: [constructor] void QPageLayout::QPageLayout(const QPageLayout& other).

C++ documentation:

Copy constructor, copies other to this.

source

pub unsafe fn orientation(&self) -> Orientation

Returns the page orientation of the page layout.

Calls C++ function: QPageLayout::Orientation QPageLayout::orientation() const.

C++ documentation:

Returns the page orientation of the page layout.

See also setOrientation().

source

pub unsafe fn page_size(&self) -> CppBox<QPageSize>

Returns the page size of the page layout.

Calls C++ function: QPageSize QPageLayout::pageSize() const.

C++ documentation:

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().

See also setPageSize().

source

pub unsafe fn paint_rect_0a(&self) -> CppBox<QRectF>

Returns the page rectangle in the current layout units.

Calls C++ function: QRectF QPageLayout::paintRect() const.

C++ documentation:

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.

source

pub unsafe fn paint_rect_1a(&self, units: Unit) -> CppBox<QRectF>

Returns the page rectangle in the required units.

Calls C++ function: QRectF QPageLayout::paintRect(QPageLayout::Unit units) const.

C++ documentation:

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.

source

pub unsafe fn paint_rect_pixels(&self, resolution: c_int) -> CppBox<QRect>

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

Calls C++ function: QRect QPageLayout::paintRectPixels(int resolution) const.

C++ documentation:

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.

source

pub unsafe fn paint_rect_points(&self) -> CppBox<QRect>

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

Calls C++ function: QRect QPageLayout::paintRectPoints() const.

C++ documentation:

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.

source

pub unsafe fn set_bottom_margin(&self, bottom_margin: c_double) -> bool

Sets the bottom page margin of the page layout to bottomMargin. Returns true if the margin was successfully set.

Calls C++ function: bool QPageLayout::setBottomMargin(double bottomMargin).

C++ documentation:

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.

If in the default StandardMode then the new margin must fall between the minimum margin set and the maximum margin allowed by the page size, otherwise the margin will not be set.

If in FullPageMode then any margin values will be accepted.

See also setMargins() and margins().

source

pub unsafe fn set_left_margin(&self, left_margin: c_double) -> bool

Sets the left page margin of the page layout to leftMargin. Returns true if the margin was successfully set.

Calls C++ function: bool QPageLayout::setLeftMargin(double leftMargin).

C++ documentation:

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.

If in the default StandardMode then the new margin must fall between the minimum margin set and the maximum margin allowed by the page size, otherwise the margin will not be set.

If in FullPageMode then any margin values will be accepted.

See also setMargins() and margins().

source

pub unsafe fn set_margins(&self, margins: impl CastInto<Ref<QMarginsF>>) -> bool

Sets the page margins of the page layout to margins Returns true if the margins were successfully set.

Calls C++ function: bool QPageLayout::setMargins(const QMarginsF& margins).

C++ documentation:

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.

If in the default StandardMode then all the new margins must fall between the minimum margins set and the maximum margins allowed by the page size, otherwise the margins will not be set.

If in FullPageMode then any margin values will be accepted.

See also margins() and units().

source

pub unsafe fn set_minimum_margins( &self, min_margins: impl CastInto<Ref<QMarginsF>> )

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

Calls C++ function: void QPageLayout::setMinimumMargins(const QMarginsF& minMargins).

C++ documentation:

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() and setMargins().

source

pub unsafe fn set_mode(&self, mode: Mode)

Sets a page layout mode to mode.

Calls C++ function: void QPageLayout::setMode(QPageLayout::Mode mode).

C++ documentation:

Sets a page layout mode to mode.

See also mode().

source

pub unsafe fn set_orientation(&self, orientation: Orientation)

Sets the page orientation of the page layout to orientation.

Calls C++ function: void QPageLayout::setOrientation(QPageLayout::Orientation orientation).

C++ documentation:

Sets the page orientation of the page layout to orientation.

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

See also orientation().

source

pub unsafe fn set_page_size_2a( &self, page_size: impl CastInto<Ref<QPageSize>>, min_margins: impl CastInto<Ref<QMarginsF>> )

Sets the page size of the page layout to pageSize.

Calls C++ function: void QPageLayout::setPageSize(const QPageSize& pageSize, const QMarginsF& minMargins = …).

C++ documentation:

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.

See also pageSize().

source

pub unsafe fn set_page_size_1a(&self, page_size: impl CastInto<Ref<QPageSize>>)

Sets the page size of the page layout to pageSize.

Calls C++ function: void QPageLayout::setPageSize(const QPageSize& pageSize).

C++ documentation:

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.

See also pageSize().

source

pub unsafe fn set_right_margin(&self, right_margin: c_double) -> bool

Sets the right page margin of the page layout to rightMargin. Returns true if the margin was successfully set.

Calls C++ function: bool QPageLayout::setRightMargin(double rightMargin).

C++ documentation:

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.

If in the default StandardMode then the new margin must fall between the minimum margin set and the maximum margin allowed by the page size, otherwise the margin will not be set.

If in FullPageMode then any margin values will be accepted.

See also setMargins() and margins().

source

pub unsafe fn set_top_margin(&self, top_margin: c_double) -> bool

Sets the top page margin of the page layout to topMargin. Returns true if the margin was successfully set.

Calls C++ function: bool QPageLayout::setTopMargin(double topMargin).

C++ documentation:

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.

If in the default StandardMode then the new margin must fall between the minimum margin set and the maximum margin allowed by the page size, otherwise the margin will not be set.

If in FullPageMode then any margin values will be accepted.

See also setMargins() and margins().

source

pub unsafe fn set_units(&self, units: Unit)

Sets the units used to define the page layout.

Calls C++ function: void QPageLayout::setUnits(QPageLayout::Unit units).

C++ documentation:

Sets the units used to define the page layout.

See also units().

source

pub unsafe fn swap(&self, other: impl CastInto<Ref<QPageLayout>>)

Swaps this page layout with other. This function is very fast and never fails.

Calls C++ function: void QPageLayout::swap(QPageLayout& other).

C++ documentation:

Swaps this page layout with other. This function is very fast and never fails.

source

pub unsafe fn units(&self) -> Unit

Returns the units the page layout is currently defined in.

Calls C++ function: QPageLayout::Unit QPageLayout::units() const.

C++ documentation:

Returns the units the page layout is currently defined in.

See also setUnits().

Trait Implementations§

source§

impl CppDeletable for QPageLayout

source§

unsafe fn delete(&self)

Destroys the page layout.

Calls C++ function: [destructor] void QPageLayout::~QPageLayout().

C++ documentation:

Destroys the page layout.

source§

impl PartialEq<Ref<QPageLayout>> for QPageLayout

source§

fn eq(&self, rhs: &Ref<QPageLayout>) -> bool

Returns true if page layout lhs is equal to page layout rhs, i.e. if all the attributes are exactly equal.

Calls C++ function: bool operator==(const QPageLayout& lhs, const QPageLayout& rhs).

C++ documentation:

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().

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.