summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglpaintdevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/opengl/qopenglpaintdevice.cpp')
-rw-r--r--src/gui/opengl/qopenglpaintdevice.cpp70
1 files changed, 68 insertions, 2 deletions
diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp
index e070ee6c58..09bd442892 100644
--- a/src/gui/opengl/qopenglpaintdevice.cpp
+++ b/src/gui/opengl/qopenglpaintdevice.cpp
@@ -111,7 +111,7 @@ QOpenGLPaintDevice::QOpenGLPaintDevice(const QSize &size)
}
/*!
- Constructs a QOpenGLPaintDevice with the given \a size and \a ctx.
+ Constructs a QOpenGLPaintDevice with the given \a width and \a height.
The QOpenGLPaintDevice is only valid for the current context.
@@ -122,11 +122,21 @@ QOpenGLPaintDevice::QOpenGLPaintDevice(int width, int height)
{
}
+/*!
+ Destroys the QOpenGLPaintDevice.
+*/
+
QOpenGLPaintDevice::~QOpenGLPaintDevice()
{
delete d_ptr->engine;
}
+/*!
+ \fn int QOpenGLPaintDevice::devType() const
+ \internal
+ \reimp
+*/
+
QOpenGLPaintDevicePrivate::QOpenGLPaintDevicePrivate(const QSize &sz)
: size(sz)
, ctx(QOpenGLContext::currentContext())
@@ -153,6 +163,10 @@ private:
Q_GLOBAL_STATIC(QOpenGLEngineThreadStorage, qt_opengl_engine)
+/*!
+ \reimp
+*/
+
QPaintEngine *QOpenGLPaintDevice::paintEngine() const
{
if (d_ptr->engine)
@@ -167,21 +181,41 @@ QPaintEngine *QOpenGLPaintDevice::paintEngine() const
return engine;
}
+/*!
+ Returns the OpenGL context associated with the paint device.
+*/
+
QOpenGLContext *QOpenGLPaintDevice::context() const
{
return d_ptr->ctx;
}
+/*!
+ Returns the pixel size of the paint device.
+
+ \sa setSize()
+*/
+
QSize QOpenGLPaintDevice::size() const
{
return d_ptr->size;
}
+/*!
+ Sets the pixel size of the paint device to \a size.
+
+ \sa size()
+*/
+
void QOpenGLPaintDevice::setSize(const QSize &size)
{
d_ptr->size = size;
}
+/*!
+ \reimp
+*/
+
int QOpenGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
{
switch (metric) {
@@ -211,34 +245,66 @@ int QOpenGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
}
}
+/*!
+ Returns the number of pixels per meter horizontally.
+
+ \sa setDotsPerMeterX()
+*/
+
qreal QOpenGLPaintDevice::dotsPerMeterX() const
{
return d_ptr->dpmx;
}
+/*!
+ Returns the number of pixels per meter vertically.
+
+ \sa setDotsPerMeterY()
+*/
+
qreal QOpenGLPaintDevice::dotsPerMeterY() const
{
return d_ptr->dpmy;
}
+/*!
+ Sets the number of pixels per meter horizontally to \a dpmx.
+
+ \sa dotsPerMeterX()
+*/
+
void QOpenGLPaintDevice::setDotsPerMeterX(qreal dpmx)
{
d_ptr->dpmx = dpmx;
}
+/*!
+ Sets the number of pixels per meter vertically to \a dpmy.
+
+ \sa dotsPerMeterY()
+*/
+
void QOpenGLPaintDevice::setDotsPerMeterY(qreal dpmy)
{
d_ptr->dpmx = dpmy;
}
/*!
- Specifies whether painting should be flipped around the Y-axis or not.
+ Sets whether painting should be flipped around the Y-axis or not to \a flipped.
+
+ \sa paintFlipped()
*/
void QOpenGLPaintDevice::setPaintFlipped(bool flipped)
{
d_ptr->flipped = flipped;
}
+/*!
+ Returns true if painting is flipped around the Y-axis.
+
+ \sa setPaintFlipped()
+*/
+
bool QOpenGLPaintDevice::paintFlipped() const
{
return d_ptr->flipped;