Struct qt_gui::QOpenGLPaintDevice
source · #[repr(C)]pub struct QOpenGLPaintDevice { /* private fields */ }
Expand description
The QOpenGLPaintDevice class enables painting to an OpenGL context using QPainter.
C++ class: QOpenGLPaintDevice
.
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
impl QOpenGLPaintDevice
sourcepub unsafe fn context(&self) -> QPtr<QOpenGLContext>
pub unsafe fn context(&self) -> QPtr<QOpenGLContext>
Returns the OpenGL context associated with the paint device.
Calls C++ function: QOpenGLContext* QOpenGLPaintDevice::context() const
.
Returns the OpenGL context associated with the paint device.
sourcepub unsafe fn dev_type(&self) -> c_int
pub unsafe fn dev_type(&self) -> c_int
Calls C++ function: virtual int QOpenGLPaintDevice::devType() const
.
sourcepub unsafe fn dots_per_meter_x(&self) -> c_double
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
.
Returns the number of pixels per meter horizontally.
See also setDotsPerMeterX().
sourcepub unsafe fn dots_per_meter_y(&self) -> c_double
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
.
Returns the number of pixels per meter vertically.
See also setDotsPerMeterY().
sourcepub unsafe fn ensure_active_target(&self)
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()
.
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.
sourcepub unsafe fn new_0a() -> CppBox<QOpenGLPaintDevice>
pub unsafe fn new_0a() -> CppBox<QOpenGLPaintDevice>
Constructs a QOpenGLPaintDevice.
Calls C++ function: [constructor] void QOpenGLPaintDevice::QOpenGLPaintDevice()
.
Constructs a QOpenGLPaintDevice.
The QOpenGLPaintDevice is only valid for the current context.
See also QOpenGLContext::currentContext().
sourcepub unsafe fn new_1a(
size: impl CastInto<Ref<QSize>>
) -> CppBox<QOpenGLPaintDevice>
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)
.
Constructs a QOpenGLPaintDevice with the given size.
The QOpenGLPaintDevice is only valid for the current context.
See also QOpenGLContext::currentContext().
sourcepub unsafe fn new_2a(width: c_int, height: c_int) -> CppBox<QOpenGLPaintDevice>
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)
.
Constructs a QOpenGLPaintDevice with the given width and height.
The QOpenGLPaintDevice is only valid for the current context.
See also QOpenGLContext::currentContext().
sourcepub unsafe fn paint_engine(&self) -> Ptr<QPaintEngine>
pub unsafe fn paint_engine(&self) -> Ptr<QPaintEngine>
Reimplemented from QPaintDevice::paintEngine().
Calls C++ function: virtual QPaintEngine* QOpenGLPaintDevice::paintEngine() const
.
Reimplemented from QPaintDevice::paintEngine().
sourcepub unsafe fn paint_flipped(&self) -> bool
pub unsafe fn paint_flipped(&self) -> bool
Returns true
if painting is flipped around the Y-axis.
Calls C++ function: bool QOpenGLPaintDevice::paintFlipped() const
.
Returns true
if painting is flipped around the Y-axis.
See also setPaintFlipped().
sourcepub unsafe fn set_device_pixel_ratio(&self, device_pixel_ratio: c_double)
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)
.
Sets the device pixel ratio for the paint device to devicePixelRatio.
sourcepub unsafe fn set_dots_per_meter_x(&self, arg1: c_double)
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)
.
Sets the number of pixels per meter horizontally to dpmx.
See also dotsPerMeterX().
sourcepub unsafe fn set_dots_per_meter_y(&self, arg1: c_double)
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)
.
Sets the number of pixels per meter vertically to dpmy.
See also dotsPerMeterY().
sourcepub unsafe fn set_paint_flipped(&self, flipped: bool)
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)
.
Sets whether painting should be flipped around the Y-axis or not to flipped.
See also paintFlipped().
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 QOpenGLPaintDevice
impl CppDeletable for QOpenGLPaintDevice
source§unsafe fn delete(&self)
unsafe fn delete(&self)
Destroys the QOpenGLPaintDevice.
Calls C++ function: virtual [destructor] void QOpenGLPaintDevice::~QOpenGLPaintDevice()
.
Destroys the QOpenGLPaintDevice.
source§impl Deref for QOpenGLPaintDevice
impl Deref for QOpenGLPaintDevice
source§fn deref(&self) -> &QPaintDevice
fn deref(&self) -> &QPaintDevice
Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QOpenGLPaintDevice* ptr)
.
§type Target = QPaintDevice
type Target = QPaintDevice
source§impl DynamicCast<QOpenGLPaintDevice> for QPaintDevice
impl DynamicCast<QOpenGLPaintDevice> for QPaintDevice
source§unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QOpenGLPaintDevice>
unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QOpenGLPaintDevice>
Calls C++ function: QOpenGLPaintDevice* dynamic_cast<QOpenGLPaintDevice*>(QPaintDevice* ptr)
.
source§impl Size for QOpenGLPaintDevice
impl Size for QOpenGLPaintDevice
source§impl StaticDowncast<QOpenGLPaintDevice> for QPaintDevice
impl StaticDowncast<QOpenGLPaintDevice> for QPaintDevice
source§unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QOpenGLPaintDevice>
unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QOpenGLPaintDevice>
Calls C++ function: QOpenGLPaintDevice* static_cast<QOpenGLPaintDevice*>(QPaintDevice* ptr)
.
source§impl StaticUpcast<QPaintDevice> for QOpenGLPaintDevice
impl StaticUpcast<QPaintDevice> for QOpenGLPaintDevice
source§unsafe fn static_upcast(ptr: Ptr<QOpenGLPaintDevice>) -> Ptr<QPaintDevice>
unsafe fn static_upcast(ptr: Ptr<QOpenGLPaintDevice>) -> Ptr<QPaintDevice>
Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QOpenGLPaintDevice* ptr)
.