Struct qt_gui::QPagedPaintDevice
source · #[repr(C)]pub struct QPagedPaintDevice { /* private fields */ }
Expand description
The QPagedPaintDevice class is a represents a paintdevice that supports multiple pages.
C++ class: QPagedPaintDevice
.
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
impl QPagedPaintDevice
sourcepub unsafe fn margins(&self) -> CppBox<Margins>
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
.
Returns the current margins of the paint device. The default is 0.
Margins are specified in millimeters.
See also setMargins().
sourcepub unsafe fn new_page(&self) -> bool
pub unsafe fn new_page(&self) -> bool
Starts a new page. Returns true
on success.
Calls C++ function: pure virtual bool QPagedPaintDevice::newPage()
.
Starts a new page. Returns true
on success.
sourcepub unsafe fn page_layout(&self) -> CppBox<QPageLayout>
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
.
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().
sourcepub unsafe fn page_size(&self) -> PageSize
pub unsafe fn page_size(&self) -> PageSize
Returns the currently used page size.
Calls C++ function: QPagedPaintDevice::PageSize QPagedPaintDevice::pageSize() const
.
Returns the currently used page size.
See also setPageSize().
sourcepub unsafe fn page_size_m_m(&self) -> CppBox<QSizeF>
pub unsafe fn page_size_m_m(&self) -> CppBox<QSizeF>
Returns the page size in millimeters.
Calls C++ function: QSizeF QPagedPaintDevice::pageSizeMM() const
.
Returns the page size in millimeters.
See also setPageSizeMM().
sourcepub unsafe fn set_margins(&self, margins: impl CastInto<Ref<Margins>>)
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)
.
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().
sourcepub unsafe fn set_page_layout(
&self,
page_layout: impl CastInto<Ref<QPageLayout>>
) -> bool
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)
.
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().
sourcepub unsafe fn set_page_margins_1a(
&self,
margins: impl CastInto<Ref<QMarginsF>>
) -> bool
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)
.
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().
sourcepub unsafe fn set_page_margins_2a(
&self,
margins: impl CastInto<Ref<QMarginsF>>,
units: Unit
) -> bool
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)
.
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().
sourcepub unsafe fn set_page_orientation(&self, orientation: Orientation) -> bool
pub unsafe fn set_page_orientation(&self, orientation: Orientation) -> bool
Sets the page orientation.
Calls C++ function: bool QPagedPaintDevice::setPageOrientation(QPageLayout::Orientation orientation)
.
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().
sourcepub unsafe fn set_page_size_q_page_size(
&self,
page_size: impl CastInto<Ref<QPageSize>>
) -> bool
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)
.
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().
sourcepub unsafe fn set_page_size_page_size(&self, size: PageSize)
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)
.
Sets the size of the a page to size.
See also setPageSizeMM().
sourcepub unsafe fn set_page_size_m_m(&self, size: impl CastInto<Ref<QSizeF>>)
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)
.
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>§
sourcepub unsafe fn color_count(&self) -> c_int
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
.
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.
sourcepub unsafe fn depth(&self) -> c_int
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
.
Returns the bit depth (number of bit planes) of the paint device.
sourcepub unsafe fn dev_type(&self) -> c_int
pub unsafe fn dev_type(&self) -> c_int
Calls C++ function: virtual int QPaintDevice::devType() const
.
sourcepub unsafe fn device_pixel_ratio(&self) -> c_int
pub unsafe fn device_pixel_ratio(&self) -> c_int
Returns the device pixel ratio for device.
Calls C++ function: int QPaintDevice::devicePixelRatio() const
.
Returns the device pixel ratio for device.
Common values are 1 for normal-dpi displays and 2 for high-dpi "retina" displays.
sourcepub unsafe fn device_pixel_ratio_f(&self) -> c_double
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
.
Returns the device pixel ratio for the device as a floating point number.
This function was introduced in Qt 5.6.
sourcepub unsafe fn height(&self) -> c_int
pub unsafe fn height(&self) -> c_int
sourcepub unsafe fn height_m_m(&self) -> c_int
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
.
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().
sourcepub unsafe fn logical_dpi_x(&self) -> c_int
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
.
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().
sourcepub unsafe fn logical_dpi_y(&self) -> c_int
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
.
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().
sourcepub unsafe fn paint_engine(&self) -> Ptr<QPaintEngine>
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
.
Returns a pointer to the paint engine used for drawing on the device.
sourcepub unsafe fn painting_active(&self) -> bool
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
.
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().
sourcepub unsafe fn physical_dpi_x(&self) -> c_int
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
.
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().
sourcepub unsafe fn physical_dpi_y(&self) -> c_int
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
.
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().
sourcepub unsafe fn width(&self) -> c_int
pub unsafe fn width(&self) -> c_int
sourcepub unsafe fn width_m_m(&self) -> c_int
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
.
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
impl CppDeletable for QPagedPaintDevice
source§impl Deref for QPagedPaintDevice
impl Deref for QPagedPaintDevice
source§fn deref(&self) -> &QPaintDevice
fn deref(&self) -> &QPaintDevice
Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QPagedPaintDevice* ptr)
.
§type Target = QPaintDevice
type Target = QPaintDevice
source§impl DynamicCast<QPagedPaintDevice> for QPaintDevice
impl DynamicCast<QPagedPaintDevice> for QPaintDevice
source§unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QPagedPaintDevice>
unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QPagedPaintDevice>
Calls C++ function: QPagedPaintDevice* dynamic_cast<QPagedPaintDevice*>(QPaintDevice* ptr)
.
source§impl DynamicCast<QPdfWriter> for QPagedPaintDevice
impl DynamicCast<QPdfWriter> for QPagedPaintDevice
source§unsafe fn dynamic_cast(ptr: Ptr<QPagedPaintDevice>) -> Ptr<QPdfWriter>
unsafe fn dynamic_cast(ptr: Ptr<QPagedPaintDevice>) -> Ptr<QPdfWriter>
Calls C++ function: QPdfWriter* dynamic_cast<QPdfWriter*>(QPagedPaintDevice* ptr)
.
source§impl StaticDowncast<QPagedPaintDevice> for QPaintDevice
impl StaticDowncast<QPagedPaintDevice> for QPaintDevice
source§unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QPagedPaintDevice>
unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QPagedPaintDevice>
Calls C++ function: QPagedPaintDevice* static_cast<QPagedPaintDevice*>(QPaintDevice* ptr)
.
source§impl StaticDowncast<QPdfWriter> for QPagedPaintDevice
impl StaticDowncast<QPdfWriter> for QPagedPaintDevice
source§unsafe fn static_downcast(ptr: Ptr<QPagedPaintDevice>) -> Ptr<QPdfWriter>
unsafe fn static_downcast(ptr: Ptr<QPagedPaintDevice>) -> Ptr<QPdfWriter>
Calls C++ function: QPdfWriter* static_cast<QPdfWriter*>(QPagedPaintDevice* ptr)
.
source§impl StaticUpcast<QPagedPaintDevice> for QPdfWriter
impl StaticUpcast<QPagedPaintDevice> for QPdfWriter
source§unsafe fn static_upcast(ptr: Ptr<QPdfWriter>) -> Ptr<QPagedPaintDevice>
unsafe fn static_upcast(ptr: Ptr<QPdfWriter>) -> Ptr<QPagedPaintDevice>
Calls C++ function: QPagedPaintDevice* static_cast<QPagedPaintDevice*>(QPdfWriter* ptr)
.
source§impl StaticUpcast<QPaintDevice> for QPagedPaintDevice
impl StaticUpcast<QPaintDevice> for QPagedPaintDevice
source§unsafe fn static_upcast(ptr: Ptr<QPagedPaintDevice>) -> Ptr<QPaintDevice>
unsafe fn static_upcast(ptr: Ptr<QPagedPaintDevice>) -> Ptr<QPaintDevice>
Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QPagedPaintDevice* ptr)
.