summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/opengl/qpixmapdata_gl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 9980f2d..43e80c1 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -586,6 +586,12 @@ QImage QGLPixmapData::toImage() const
if (m_renderFbo) {
copyBackFromRenderFbo(true);
} else if (!m_source.isNull()) {
+ QImageData *data = const_cast<QImage &>(m_source).data_ptr();
+ if (data->paintEngine && data->paintEngine->isActive()
+ && data->paintEngine->paintDevice() == &m_source)
+ {
+ return m_source.copy();
+ }
return m_source;
} else if (m_dirty || m_hasFillColor) {
return fillImage(m_fillColor);