diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2012-05-31 15:25:02 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-01 13:06:24 +0200 |
commit | 8dd443034dda9505282b625b9895b15e1ac9a27d (patch) | |
tree | 18f3a53dc04ea7804bc2682b93e3981b0bfde083 /src/gui/opengl/qopenglpaintdevice.cpp | |
parent | 5a447502b539c10a399f9d6579efbae6ef5ca9f0 (diff) |
Add method to set size of QOpenGLPaintDevice.
Change-Id: Iecc72c64dbb5f35ee41bdeb960bc759cd43b8bcb
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/opengl/qopenglpaintdevice.cpp')
-rw-r--r-- | src/gui/opengl/qopenglpaintdevice.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp index 32da27a078..ff4b76db01 100644 --- a/src/gui/opengl/qopenglpaintdevice.cpp +++ b/src/gui/opengl/qopenglpaintdevice.cpp @@ -83,11 +83,21 @@ public: bool flipped; QPaintEngine *engine; - - void init(const QSize &size, QOpenGLContext *ctx); }; /*! + Constructs a QOpenGLPaintDevice. + + The QOpenGLPaintDevice is only valid for the current context. + + \sa QOpenGLContext::currentContext() +*/ +QOpenGLPaintDevice::QOpenGLPaintDevice() + : d_ptr(new QOpenGLPaintDevicePrivate(QSize())) +{ +} + +/*! Constructs a QOpenGLPaintDevice with the given \a size. The QOpenGLPaintDevice is only valid for the current context. @@ -166,6 +176,11 @@ QSize QOpenGLPaintDevice::size() const return d_ptr->size; } +void QOpenGLPaintDevice::setSize(const QSize &size) +{ + d_ptr->size = size; +} + int QOpenGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const { switch (metric) { |