![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QOpenGLPaintDevice class enables painting to an OpenGL context using QPainter. More...
#include <qopenglpaintdevice.h>
Public Member Functions | |
QOpenGLPaintDevice () | |
Constructs a QOpenGLPaintDevice. | |
QOpenGLPaintDevice (const QSize &size) | |
Constructs a QOpenGLPaintDevice with the given size. | |
QOpenGLPaintDevice (int width, int height) | |
Constructs a QOpenGLPaintDevice with the given width and height. | |
~QOpenGLPaintDevice () | |
Destroys the QOpenGLPaintDevice. | |
int | devType () const override |
QPaintEngine * | paintEngine () const override |
\reimp | |
QOpenGLContext * | context () const |
Returns the OpenGL context associated with the paint device. | |
QSize | size () const |
Returns the pixel size of the paint device. | |
void | setSize (const QSize &size) |
Sets the pixel size of the paint device to size. | |
void | setDevicePixelRatio (qreal devicePixelRatio) |
Sets the device pixel ratio for the paint device to devicePixelRatio. | |
qreal | dotsPerMeterX () const |
Returns the number of pixels per meter horizontally. | |
qreal | dotsPerMeterY () const |
Returns the number of pixels per meter vertically. | |
void | setDotsPerMeterX (qreal) |
Sets the number of pixels per meter horizontally to dpmx. | |
void | setDotsPerMeterY (qreal) |
Sets the number of pixels per meter vertically to dpmy. | |
void | setPaintFlipped (bool flipped) |
Sets whether painting should be flipped around the Y-axis or not to flipped. | |
bool | paintFlipped () const |
Returns true if painting is flipped around the Y-axis. | |
virtual void | 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. | |
![]() | |
virtual | ~QPaintDevice () |
bool | paintingActive () const |
int | width () const |
int | height () const |
int | widthMM () const |
int | heightMM () const |
int | logicalDpiX () const |
int | logicalDpiY () const |
int | physicalDpiX () const |
int | physicalDpiY () const |
qreal | devicePixelRatio () const |
qreal | devicePixelRatioF () const |
int | colorCount () const |
int | depth () const |
Protected Member Functions | |
QOpenGLPaintDevice (QOpenGLPaintDevicePrivate &dd) | |
int | metric (QPaintDevice::PaintDeviceMetric metric) const override |
\reimp | |
![]() | |
QPaintDevice () noexcept | |
virtual void | initPainter (QPainter *painter) const |
virtual QPaintDevice * | redirected (QPoint *offset) const |
virtual QPainter * | sharedPainter () const |
double | getDecodedMetricF (PaintDeviceMetric metricA, PaintDeviceMetric metricB) const |
Protected Attributes | |
QScopedPointer< QOpenGLPaintDevicePrivate > | d_ptr |
![]() | |
ushort | painters |
Additional Inherited Members | |
![]() | |
enum | PaintDeviceMetric { PdmWidth = 1 , PdmHeight , PdmWidthMM , PdmHeightMM , PdmNumColors , PdmDepth , PdmDpiX , PdmDpiY , PdmPhysicalDpiX , PdmPhysicalDpiY , PdmDevicePixelRatio , PdmDevicePixelRatioScaled , PdmDevicePixelRatioF_EncodedA , PdmDevicePixelRatioF_EncodedB } |
![]() | |
static qreal | devicePixelRatioFScale () |
static int | encodeMetricF (PaintDeviceMetric metric, double value) |
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.
Definition at line 19 of file qopenglpaintdevice.h.
QOpenGLPaintDevice::QOpenGLPaintDevice | ( | ) |
Constructs a QOpenGLPaintDevice.
The QOpenGLPaintDevice is only valid for the current context.
Definition at line 79 of file qopenglpaintdevice.cpp.
|
explicit |
Constructs a QOpenGLPaintDevice with the given size.
The QOpenGLPaintDevice is only valid for the current context.
Definition at line 91 of file qopenglpaintdevice.cpp.
QOpenGLPaintDevice::QOpenGLPaintDevice | ( | int | width, |
int | height ) |
Constructs a QOpenGLPaintDevice with the given width and height.
The QOpenGLPaintDevice is only valid for the current context.
Definition at line 103 of file qopenglpaintdevice.cpp.
QOpenGLPaintDevice::~QOpenGLPaintDevice | ( | ) |
Destroys the QOpenGLPaintDevice.
Definition at line 120 of file qopenglpaintdevice.cpp.
|
protected |
Definition at line 111 of file qopenglpaintdevice.cpp.
QOpenGLContext * QOpenGLPaintDevice::context | ( | ) | const |
Returns the OpenGL context associated with the paint device.
Definition at line 184 of file qopenglpaintdevice.cpp.
|
inlineoverridevirtual |
qreal QOpenGLPaintDevice::dotsPerMeterX | ( | ) | const |
Returns the number of pixels per meter horizontally.
Definition at line 267 of file qopenglpaintdevice.cpp.
qreal QOpenGLPaintDevice::dotsPerMeterY | ( | ) | const |
Returns the number of pixels per meter vertically.
Definition at line 278 of file qopenglpaintdevice.cpp.
|
virtual |
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.
\l{QPainter::beginNativePainting()}{beginNativePainting()} will also trigger this method.
The default implementation does nothing.
Reimplemented in QOpenGLWidgetPaintDevice, QOpenGLWidgetPaintDevice, QOpenGLWindowPaintDevice, and QOpenGLWindowPaintDevice.
Definition at line 336 of file qopenglpaintdevice.cpp.
|
overrideprotectedvirtual |
|
overridevirtual |
bool QOpenGLPaintDevice::paintFlipped | ( | ) | const |
Returns true
if painting is flipped around the Y-axis.
Definition at line 321 of file qopenglpaintdevice.cpp.
Sets the device pixel ratio for the paint device to devicePixelRatio.
Definition at line 214 of file qopenglpaintdevice.cpp.
Sets the number of pixels per meter horizontally to dpmx.
Definition at line 289 of file qopenglpaintdevice.cpp.
Sets the number of pixels per meter vertically to dpmy.
Definition at line 300 of file qopenglpaintdevice.cpp.
void QOpenGLPaintDevice::setPaintFlipped | ( | bool | flipped | ) |
Sets whether painting should be flipped around the Y-axis or not to flipped.
Definition at line 310 of file qopenglpaintdevice.cpp.
Sets the pixel size of the paint device to size.
Definition at line 206 of file qopenglpaintdevice.cpp.
QSize QOpenGLPaintDevice::size | ( | ) | const |
Returns the pixel size of the paint device.
Definition at line 195 of file qopenglpaintdevice.cpp.
|
protected |
Definition at line 52 of file qopenglpaintdevice.h.