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

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.

Implementations§

source§

impl QPagedPaintDevice

source

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

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

source

pub unsafe fn new_page(&self) -> bool

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.

source

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

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

source

pub unsafe fn page_size(&self) -> PageSize

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

source

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

Returns the page size in millimeters.

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

C++ documentation:

Returns the page size in millimeters.

See also setPageSizeMM().

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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>§

source

pub unsafe fn color_count(&self) -> c_int

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.

source

pub unsafe fn depth(&self) -> c_int

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.

source

pub unsafe fn dev_type(&self) -> c_int

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

source

pub unsafe fn device_pixel_ratio(&self) -> c_int

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.

source

pub unsafe fn device_pixel_ratio_f(&self) -> c_double

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.

source

pub unsafe fn height(&self) -> c_int

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

source

pub unsafe fn height_m_m(&self) -> c_int

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

source

pub unsafe fn logical_dpi_x(&self) -> c_int

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

source

pub unsafe fn logical_dpi_y(&self) -> c_int

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

source

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

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.

source

pub unsafe fn painting_active(&self) -> bool

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

source

pub unsafe fn physical_dpi_x(&self) -> c_int

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

source

pub unsafe fn physical_dpi_y(&self) -> c_int

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

source

pub unsafe fn width(&self) -> c_int

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

source

pub unsafe fn width_m_m(&self) -> c_int

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§

source§

impl CppDeletable for QPagedPaintDevice

source§

unsafe fn delete(&self)

Destroys the object.

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

C++ documentation:

Destroys the object.

source§

impl Deref for QPagedPaintDevice

source§

fn deref(&self) -> &QPaintDevice

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

§

type Target = QPaintDevice

The resulting type after dereferencing.
source§

impl DynamicCast<QPagedPaintDevice> for QPaintDevice

source§

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

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

source§

impl DynamicCast<QPdfWriter> for QPagedPaintDevice

source§

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

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

source§

impl StaticDowncast<QPagedPaintDevice> for QPaintDevice

source§

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

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

source§

impl StaticDowncast<QPdfWriter> for QPagedPaintDevice

source§

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

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

source§

impl StaticUpcast<QPagedPaintDevice> for QPdfWriter

source§

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

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

source§

impl StaticUpcast<QPaintDevice> for QPagedPaintDevice

source§

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

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

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.