[][src]Struct qt_gui::QPagedPaintDevice

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

The QPagedPaintDevice class is a represents a paintdevice that supports multiple pages.

C++ class: QPagedPaintDevice.

C++ documentation:

The QPagedPaintDevice class is a represents a paintdevice that supports multiple pages.

Paged paint devices are used to generate output for printing or for formats like PDF. QPdfWriter and QPrinter inherit from it.

Methods

impl QPagedPaintDevice[src]

pub unsafe fn margins(&self) -> CppBox<Margins>[src]

Returns the current margins of the paint device. The default is 0.

Calls C++ function: QPagedPaintDevice::Margins QPagedPaintDevice::margins() const.

C++ documentation:

Returns the current margins of the paint device. The default is 0.

Margins are specified in millimeters.

See also setMargins().

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

Starts a new page. Returns true on success.

Calls C++ function: pure virtual bool QPagedPaintDevice::newPage().

C++ documentation:

Starts a new page. Returns true on success.

pub unsafe fn page_layout(&self) -> CppBox<QPageLayout>[src]

Returns the current page layout. Use this method to access the current QPageSize, QPageLayout::Orientation, QMarginsF, fullRect() and paintRect().

Calls C++ function: QPageLayout QPagedPaintDevice::pageLayout() const.

C++ documentation:

Returns the current page layout. Use this method to access the current QPageSize, QPageLayout::Orientation, QMarginsF, fullRect() and paintRect().

Note that you cannot use the setters on the returned object, you must either call the individual QPagedPaintDevice setters or use setPageLayout().

This function was introduced in Qt 5.3.

See also setPageLayout(), setPageSize(), setPageOrientation(), and setPageMargins().

pub unsafe fn page_size(&self) -> PageSize[src]

Returns the currently used page size.

Calls C++ function: QPagedPaintDevice::PageSize QPagedPaintDevice::pageSize() const.

C++ documentation:

Returns the currently used page size.

See also setPageSize().

pub unsafe fn page_size_m_m(&self) -> CppBox<QSizeF>[src]

Returns the page size in millimeters.

Calls C++ function: QSizeF QPagedPaintDevice::pageSizeMM() const.

C++ documentation:

Returns the page size in millimeters.

See also setPageSizeMM().

pub unsafe fn set_margins(&self, margins: impl CastInto<Ref<Margins>>)[src]

Sets the margins to be used to margins.

Calls C++ function: virtual void QPagedPaintDevice::setMargins(const QPagedPaintDevice::Margins& margins).

C++ documentation:

Sets the margins to be used to margins.

Margins are specified in millimeters.

The margins are purely a hint to the drawing method. They don't affect the coordinate system or clipping.

See also margins().

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

Sets the page layout to newPageLayout.

Calls C++ function: bool QPagedPaintDevice::setPageLayout(const QPageLayout& pageLayout).

C++ documentation:

Sets the page layout to newPageLayout.

You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new page layout to a new page. You should not call any painting methods between a call to setPageLayout() and newPage() as the wrong paint metrics may be used.

Returns true if the page layout was successfully set to newPageLayout.

This function was introduced in Qt 5.3.

See also pageLayout().

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

Set the page margins in the current page layout units.

Calls C++ function: bool QPagedPaintDevice::setPageMargins(const QMarginsF& margins).

C++ documentation:

Set the page margins in the current page layout units.

You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new margins to a new page. You should not call any painting methods between a call to setPageMargins() and newPage() as the wrong paint metrics may be used.

To get the current page margins use pageLayout().pageMargins().

Returns true if the page margins were successfully set to margins.

This function was introduced in Qt 5.3.

See also pageLayout().

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

Set the page margins defined in the given units.

Calls C++ function: bool QPagedPaintDevice::setPageMargins(const QMarginsF& margins, QPageLayout::Unit units).

C++ documentation:

Set the page margins defined in the given units.

You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new margins to a new page. You should not call any painting methods between a call to setPageMargins() and newPage() as the wrong paint metrics may be used.

To get the current page margins use pageLayout().pageMargins().

Returns true if the page margins were successfully set to margins.

This function was introduced in Qt 5.3.

See also pageLayout().

pub unsafe fn set_page_orientation(&self, orientation: Orientation) -> bool[src]

Sets the page orientation.

Calls C++ function: bool QPagedPaintDevice::setPageOrientation(QPageLayout::Orientation orientation).

C++ documentation:

Sets the page orientation.

The page orientation is used to define the orientation of the page size when obtaining the page rect.

You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new orientation to a new page. You should not call any painting methods between a call to setPageOrientation() and newPage() as the wrong paint metrics may be used.

To get the current QPageLayout::Orientation use pageLayout().pageOrientation().

Returns true if the page orientation was successfully set to orientation.

This function was introduced in Qt 5.3.

See also pageLayout().

pub unsafe fn set_page_size_q_page_size(
    &self,
    page_size: impl CastInto<Ref<QPageSize>>
) -> bool
[src]

Sets the page size to pageSize.

Calls C++ function: bool QPagedPaintDevice::setPageSize(const QPageSize& pageSize).

C++ documentation:

Sets the page size to pageSize.

To get the current QPageSize use pageLayout().pageSize().

You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new page size to a new page. You should not call any painting methods between a call to setPageSize() and newPage() as the wrong paint metrics may be used.

Returns true if the page size was successfully set to pageSize.

This function was introduced in Qt 5.3.

See also pageSize() and pageLayout().

pub unsafe fn set_page_size_page_size(&self, size: PageSize)[src]

Sets the size of the a page to size.

Calls C++ function: virtual void QPagedPaintDevice::setPageSize(QPagedPaintDevice::PageSize size).

C++ documentation:

Sets the size of the a page to size.

See also setPageSizeMM().

pub unsafe fn set_page_size_m_m(&self, size: impl CastInto<Ref<QSizeF>>)[src]

Sets the page size to size. size is specified in millimeters.

Calls C++ function: virtual void QPagedPaintDevice::setPageSizeMM(const QSizeF& size).

C++ documentation:

Sets the page size to size. size is specified in millimeters.

If the size matches a standard QPagedPaintDevice::PageSize then that page size will be used, otherwise QPagedPaintDevice::Custom will be set.

See also pageSizeMM().

Methods from Deref<Target = QPaintDevice>

pub unsafe fn color_count(&self) -> c_int[src]

Returns the number of different colors available for the paint device. If the number of colors available is too great to be represented by the int data type, then INT_MAX will be returned instead.

Calls C++ function: int QPaintDevice::colorCount() const.

C++ documentation:

Returns the number of different colors available for the paint device. If the number of colors available is too great to be represented by the int data type, then INT_MAX will be returned instead.

pub unsafe fn depth(&self) -> c_int[src]

Returns the bit depth (number of bit planes) of the paint device.

Calls C++ function: int QPaintDevice::depth() const.

C++ documentation:

Returns the bit depth (number of bit planes) of the paint device.

pub unsafe fn dev_type(&self) -> c_int[src]

Calls C++ function: virtual int QPaintDevice::devType() const.

pub unsafe fn device_pixel_ratio(&self) -> c_int[src]

Returns the device pixel ratio for device.

Calls C++ function: int QPaintDevice::devicePixelRatio() const.

C++ documentation:

Returns the device pixel ratio for device.

Common values are 1 for normal-dpi displays and 2 for high-dpi "retina" displays.

pub unsafe fn device_pixel_ratio_f(&self) -> c_double[src]

Returns the device pixel ratio for the device as a floating point number.

Calls C++ function: double QPaintDevice::devicePixelRatioF() const.

C++ documentation:

Returns the device pixel ratio for the device as a floating point number.

This function was introduced in Qt 5.6.

pub unsafe fn height(&self) -> c_int[src]

Returns the height of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget).

Calls C++ function: int QPaintDevice::height() const.

C++ documentation:

Returns the height of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget).

See also heightMM().

pub unsafe fn height_m_m(&self) -> c_int[src]

Returns the height of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

Calls C++ function: int QPaintDevice::heightMM() const.

C++ documentation:

Returns the height of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

See also height().

pub unsafe fn logical_dpi_x(&self) -> c_int[src]

Returns the horizontal resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from widthMM().

Calls C++ function: int QPaintDevice::logicalDpiX() const.

C++ documentation:

Returns the horizontal resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from widthMM().

Note that if the logicalDpiX() doesn't equal the physicalDpiX(), the corresponding QPaintEngine must handle the resolution mapping.

See also logicalDpiY() and physicalDpiX().

pub unsafe fn logical_dpi_y(&self) -> c_int[src]

Returns the vertical resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from heightMM().

Calls C++ function: int QPaintDevice::logicalDpiY() const.

C++ documentation:

Returns the vertical resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from heightMM().

Note that if the logicalDpiY() doesn't equal the physicalDpiY(), the corresponding QPaintEngine must handle the resolution mapping.

See also logicalDpiX() and physicalDpiY().

pub unsafe fn paint_engine(&self) -> Ptr<QPaintEngine>[src]

Returns a pointer to the paint engine used for drawing on the device.

Calls C++ function: pure virtual QPaintEngine* QPaintDevice::paintEngine() const.

C++ documentation:

Returns a pointer to the paint engine used for drawing on the device.

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

Returns true if the device is currently being painted on, i.e. someone has called QPainter::begin() but not yet called QPainter::end() for this device; otherwise returns false.

Calls C++ function: bool QPaintDevice::paintingActive() const.

C++ documentation:

Returns true if the device is currently being painted on, i.e. someone has called QPainter::begin() but not yet called QPainter::end() for this device; otherwise returns false.

See also QPainter::isActive().

pub unsafe fn physical_dpi_x(&self) -> c_int[src]

Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer's resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Calls C++ function: int QPaintDevice::physicalDpiX() const.

C++ documentation:

Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer's resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Note that if the physicalDpiX() doesn't equal the logicalDpiX(), the corresponding QPaintEngine must handle the resolution mapping.

See also physicalDpiY() and logicalDpiX().

pub unsafe fn physical_dpi_y(&self) -> c_int[src]

Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer's resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Calls C++ function: int QPaintDevice::physicalDpiY() const.

C++ documentation:

Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer's resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Note that if the physicalDpiY() doesn't equal the logicalDpiY(), the corresponding QPaintEngine must handle the resolution mapping.

See also physicalDpiX() and logicalDpiY().

pub unsafe fn width(&self) -> c_int[src]

Returns the width of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget).

Calls C++ function: int QPaintDevice::width() const.

C++ documentation:

Returns the width of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget).

See also widthMM().

pub unsafe fn width_m_m(&self) -> c_int[src]

Returns the width of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

Calls C++ function: int QPaintDevice::widthMM() const.

C++ documentation:

Returns the width of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

See also width().

Trait Implementations

impl CppDeletable for QPagedPaintDevice[src]

unsafe fn delete(&self)[src]

Destroys the object.

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

C++ documentation:

Destroys the object.

impl Deref for QPagedPaintDevice[src]

type Target = QPaintDevice

The resulting type after dereferencing.

fn deref(&self) -> &QPaintDevice[src]

Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QPagedPaintDevice* ptr).

impl DynamicCast<QPagedPaintDevice> for QPaintDevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QPagedPaintDevice>[src]

Calls C++ function: QPagedPaintDevice* dynamic_cast<QPagedPaintDevice*>(QPaintDevice* ptr).

impl DynamicCast<QPdfWriter> for QPagedPaintDevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QPagedPaintDevice>) -> Ptr<QPdfWriter>[src]

Calls C++ function: QPdfWriter* dynamic_cast<QPdfWriter*>(QPagedPaintDevice* ptr).

impl StaticDowncast<QPagedPaintDevice> for QPaintDevice[src]

unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QPagedPaintDevice>[src]

Calls C++ function: QPagedPaintDevice* static_cast<QPagedPaintDevice*>(QPaintDevice* ptr).

impl StaticDowncast<QPdfWriter> for QPagedPaintDevice[src]

unsafe fn static_downcast(ptr: Ptr<QPagedPaintDevice>) -> Ptr<QPdfWriter>[src]

Calls C++ function: QPdfWriter* static_cast<QPdfWriter*>(QPagedPaintDevice* ptr).

impl StaticUpcast<QPagedPaintDevice> for QPdfWriter[src]

unsafe fn static_upcast(ptr: Ptr<QPdfWriter>) -> Ptr<QPagedPaintDevice>[src]

Calls C++ function: QPagedPaintDevice* static_cast<QPagedPaintDevice*>(QPdfWriter* ptr).

impl StaticUpcast<QPaintDevice> for QPagedPaintDevice[src]

unsafe fn static_upcast(ptr: Ptr<QPagedPaintDevice>) -> Ptr<QPaintDevice>[src]

Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QPagedPaintDevice* ptr).

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.