Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QOpenGLWidgetPaintDevice Class Reference
+ Inheritance diagram for QOpenGLWidgetPaintDevice:
+ Collaboration diagram for QOpenGLWidgetPaintDevice:

Public Member Functions

 QOpenGLWidgetPaintDevice (QOpenGLWidget *widget)
 
void ensureActiveTarget () override
 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.
 
- Public Member Functions inherited from QOpenGLPaintDevice
 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
 
QPaintEnginepaintEngine () const override
 \reimp
 
QOpenGLContextcontext () 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.
 
- Public Member Functions inherited from QPaintDevice
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
 

Additional Inherited Members

- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric {
  PdmWidth = 1 , PdmHeight , PdmWidthMM , PdmHeightMM ,
  PdmNumColors , PdmDepth , PdmDpiX , PdmDpiY ,
  PdmPhysicalDpiX , PdmPhysicalDpiY , PdmDevicePixelRatio , PdmDevicePixelRatioScaled
}
 
- Static Public Member Functions inherited from QPaintDevice
static qreal devicePixelRatioFScale ()
 
- Protected Member Functions inherited from QOpenGLPaintDevice
 QOpenGLPaintDevice (QOpenGLPaintDevicePrivate &dd)
 
int metric (QPaintDevice::PaintDeviceMetric metric) const override
 \reimp
 
- Protected Member Functions inherited from QPaintDevice
 QPaintDevice () noexcept
 
virtual void initPainter (QPainter *painter) const
 
virtual QPaintDeviceredirected (QPoint *offset) const
 
virtual QPaintersharedPainter () const
 
- Protected Attributes inherited from QOpenGLPaintDevice
QScopedPointer< QOpenGLPaintDevicePrivated_ptr
 
- Protected Attributes inherited from QPaintDevice
ushort painters
 

Detailed Description

Definition at line 529 of file qopenglwidget.cpp.

Constructor & Destructor Documentation

◆ QOpenGLWidgetPaintDevice()

QOpenGLWidgetPaintDevice::QOpenGLWidgetPaintDevice ( QOpenGLWidget * widget)
inlineexplicit

Definition at line 532 of file qopenglwidget.cpp.

Member Function Documentation

◆ ensureActiveTarget()

void QOpenGLWidgetPaintDevice::ensureActiveTarget ( )
overridevirtual

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 from QOpenGLPaintDevice.

Definition at line 629 of file qopenglwidget.cpp.

References QOpenGLFramebufferObject::bind(), QOpenGLWidgetPrivate::context, QOpenGLContext::currentContext(), QOpenGLWidgetPrivate::currentTargetBuffer, d, QOpenGLPaintDevice::d_ptr, QScopedPointer< T, Cleanup >::data(), QOpenGLWidgetPrivate::fbos, QOpenGLWidgetPrivate::flushPending, QOpenGLContextPrivate::get(), QWidgetPrivate::get(), QOpenGLFramebufferObject::handle(), QOpenGLWidgetPrivate::initialized, and QOpenGLWidgetPrivate::inPaintGL.

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: