[][src]Struct qt_gui::QPageLayout

#[repr(C)]
pub struct QPageLayout { /* fields omitted */ }

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.

Methods

impl QPageLayout[src]

pub unsafe fn copy_from(
    &mut self,
    other: impl CastInto<Ref<QPageLayout>>
) -> MutRef<QPageLayout>
[src]

Assignment operator, assigns other to this.

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

C++ documentation:

Assignment operator, assigns other to this.

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

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

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

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

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

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

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

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

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

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.

pub unsafe fn is_valid(&self) -> bool[src]

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.

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

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

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

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

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

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

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

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

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

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

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

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

pub unsafe fn mode(&self) -> Mode[src]

Returns the page layout mode.

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

C++ documentation:

Returns the page layout mode.

See also setMode().

pub unsafe fn new_0a() -> CppBox<QPageLayout>[src]

Creates an invalid QPageLayout.

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

C++ documentation:

Creates an invalid QPageLayout.

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>
[src]

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.

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

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.

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

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.

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

Copy constructor, copies other to this.

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

C++ documentation:

Copy constructor, copies other to this.

pub unsafe fn orientation(&self) -> Orientation[src]

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

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

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

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

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.

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

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.

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

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.

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

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.

pub unsafe fn set_bottom_margin(&mut self, bottom_margin: c_double) -> bool[src]

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

pub unsafe fn set_left_margin(&mut self, left_margin: c_double) -> bool[src]

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

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

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

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

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

pub unsafe fn set_mode(&mut self, mode: Mode)[src]

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

pub unsafe fn set_orientation(&mut self, orientation: Orientation)[src]

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

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

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

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

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

pub unsafe fn set_right_margin(&mut self, right_margin: c_double) -> bool[src]

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

pub unsafe fn set_top_margin(&mut self, top_margin: c_double) -> bool[src]

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

pub unsafe fn set_units(&mut self, units: Unit)[src]

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

pub unsafe fn swap(&mut self, other: impl CastInto<MutRef<QPageLayout>>)[src]

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.

pub unsafe fn units(&self) -> Unit[src]

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

impl CppDeletable for QPageLayout[src]

unsafe fn delete(&mut self)[src]

Destroys the page layout.

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

C++ documentation:

Destroys the page layout.

impl PartialEq<Ref<QPageLayout>> for QPageLayout[src]

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

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

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.