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

The QOpenGLPaintDevice class enables painting to an OpenGL context using QPainter.

C++ class: QOpenGLPaintDevice.

C++ documentation:

The QOpenGLPaintDevice class enables painting to an OpenGL context using QPainter.

The QOpenGLPaintDevice uses the current QOpenGL context to render QPainter draw commands. The context is captured upon construction. It requires support for OpenGL (ES) 2.0 or higher.

Implementations§

source§

impl QOpenGLPaintDevice

source

pub unsafe fn context(&self) -> QPtr<QOpenGLContext>

Returns the OpenGL context associated with the paint device.

Calls C++ function: QOpenGLContext* QOpenGLPaintDevice::context() const.

C++ documentation:

Returns the OpenGL context associated with the paint device.

source

pub unsafe fn dev_type(&self) -> c_int

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

source

pub unsafe fn dots_per_meter_x(&self) -> c_double

Returns the number of pixels per meter horizontally.

Calls C++ function: double QOpenGLPaintDevice::dotsPerMeterX() const.

C++ documentation:

Returns the number of pixels per meter horizontally.

See also setDotsPerMeterX().

source

pub unsafe fn dots_per_meter_y(&self) -> c_double

Returns the number of pixels per meter vertically.

Calls C++ function: double QOpenGLPaintDevice::dotsPerMeterY() const.

C++ documentation:

Returns the number of pixels per meter vertically.

See also setDotsPerMeterY().

source

pub unsafe fn ensure_active_target(&self)

This virtual method is provided as a callback to allow re-binding a target frame buffer object or context when different QOpenGLPaintDevice instances are issuing draw calls alternately.

Calls C++ function: virtual void QOpenGLPaintDevice::ensureActiveTarget().

C++ documentation:

This virtual method is provided as a callback to allow re-binding a target frame buffer object or context when different QOpenGLPaintDevice instances are issuing draw calls alternately.

beginNativePainting() will also trigger this method.

The default implementation does nothing.

source

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

Constructs a QOpenGLPaintDevice.

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

C++ documentation:

Constructs a QOpenGLPaintDevice.

The QOpenGLPaintDevice is only valid for the current context.

See also QOpenGLContext::currentContext().

source

pub unsafe fn new_1a( size: impl CastInto<Ref<QSize>> ) -> CppBox<QOpenGLPaintDevice>

Constructs a QOpenGLPaintDevice with the given size.

Calls C++ function: [constructor] void QOpenGLPaintDevice::QOpenGLPaintDevice(const QSize& size).

C++ documentation:

Constructs a QOpenGLPaintDevice with the given size.

The QOpenGLPaintDevice is only valid for the current context.

See also QOpenGLContext::currentContext().

source

pub unsafe fn new_2a(width: c_int, height: c_int) -> CppBox<QOpenGLPaintDevice>

Constructs a QOpenGLPaintDevice with the given width and height.

Calls C++ function: [constructor] void QOpenGLPaintDevice::QOpenGLPaintDevice(int width, int height).

C++ documentation:

Constructs a QOpenGLPaintDevice with the given width and height.

The QOpenGLPaintDevice is only valid for the current context.

See also QOpenGLContext::currentContext().

source

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

Reimplemented from QPaintDevice::paintEngine().

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

C++ documentation:

Reimplemented from QPaintDevice::paintEngine().

source

pub unsafe fn paint_flipped(&self) -> bool

Returns true if painting is flipped around the Y-axis.

Calls C++ function: bool QOpenGLPaintDevice::paintFlipped() const.

C++ documentation:

Returns true if painting is flipped around the Y-axis.

See also setPaintFlipped().

source

pub unsafe fn set_device_pixel_ratio(&self, device_pixel_ratio: c_double)

Sets the device pixel ratio for the paint device to devicePixelRatio.

Calls C++ function: void QOpenGLPaintDevice::setDevicePixelRatio(double devicePixelRatio).

C++ documentation:

Sets the device pixel ratio for the paint device to devicePixelRatio.

source

pub unsafe fn set_dots_per_meter_x(&self, arg1: c_double)

Sets the number of pixels per meter horizontally to dpmx.

Calls C++ function: void QOpenGLPaintDevice::setDotsPerMeterX(double arg1).

C++ documentation:

Sets the number of pixels per meter horizontally to dpmx.

See also dotsPerMeterX().

source

pub unsafe fn set_dots_per_meter_y(&self, arg1: c_double)

Sets the number of pixels per meter vertically to dpmy.

Calls C++ function: void QOpenGLPaintDevice::setDotsPerMeterY(double arg1).

C++ documentation:

Sets the number of pixels per meter vertically to dpmy.

See also dotsPerMeterY().

source

pub unsafe fn set_paint_flipped(&self, flipped: bool)

Sets whether painting should be flipped around the Y-axis or not to flipped.

Calls C++ function: void QOpenGLPaintDevice::setPaintFlipped(bool flipped).

C++ documentation:

Sets whether painting should be flipped around the Y-axis or not to flipped.

See also paintFlipped().

source

pub unsafe fn set_size(&self, size: impl CastInto<Ref<QSize>>)

Sets the pixel size of the paint device to size.

Calls C++ function: void QOpenGLPaintDevice::setSize(const QSize& size).

C++ documentation:

Sets the pixel size of the paint device to size.

See also size().

source

pub unsafe fn size(&self) -> CppBox<QSize>

Returns the pixel size of the paint device.

Calls C++ function: QSize QOpenGLPaintDevice::size() const.

C++ documentation:

Returns the pixel size of the paint device.

See also setSize().

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 QOpenGLPaintDevice

source§

unsafe fn delete(&self)

Destroys the QOpenGLPaintDevice.

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

C++ documentation:

Destroys the QOpenGLPaintDevice.

source§

impl Deref for QOpenGLPaintDevice

source§

fn deref(&self) -> &QPaintDevice

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

§

type Target = QPaintDevice

The resulting type after dereferencing.
source§

impl DynamicCast<QOpenGLPaintDevice> for QPaintDevice

source§

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

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

source§

impl Size for QOpenGLPaintDevice

source§

unsafe fn size(&self) -> usize

Returns the pixel size of the paint device.

Calls C++ function: QSize QOpenGLPaintDevice::size() const.

C++ documentation:

Returns the pixel size of the paint device.

See also setSize().

source§

impl StaticDowncast<QOpenGLPaintDevice> for QPaintDevice

source§

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

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

source§

impl StaticUpcast<QPaintDevice> for QOpenGLPaintDevice

source§

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

Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QOpenGLPaintDevice* 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.