[][src]Struct qt_gui::QOpenGLPaintDevice

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

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.

Methods

impl QOpenGLPaintDevice[src]

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

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.

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

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

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

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

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

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

pub unsafe fn ensure_active_target(&self)[src]

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.

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

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

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

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

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

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

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

Reimplemented from QPaintDevice::paintEngine().

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

C++ documentation:

Reimplemented from QPaintDevice::paintEngine().

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

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

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

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.

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

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

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

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

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

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

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

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

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

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>

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

unsafe fn delete(&self)[src]

Destroys the QOpenGLPaintDevice.

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

C++ documentation:

Destroys the QOpenGLPaintDevice.

impl Deref for QOpenGLPaintDevice[src]

type Target = QPaintDevice

The resulting type after dereferencing.

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

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

impl DynamicCast<QOpenGLPaintDevice> for QPaintDevice[src]

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

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

impl Size for QOpenGLPaintDevice[src]

unsafe fn size(&self) -> usize[src]

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

impl StaticDowncast<QOpenGLPaintDevice> for QPaintDevice[src]

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

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

impl StaticUpcast<QPaintDevice> for QOpenGLPaintDevice[src]

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

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