summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap_raster.cpp
diff options
context:
space:
mode:
authorA-Team <ateam@pad.test.qt.nokia.com>2010-12-08 23:00:17 (GMT)
committerA-Team <ateam@pad.test.qt.nokia.com>2010-12-08 23:00:17 (GMT)
commit40d8ec7118d5f39acec3f71d33a87f0483bd2b2b (patch)
tree00ce4201855b5fe1d937673d0419bfe6dc798571 /src/gui/image/qpixmap_raster.cpp
parent25bd4015310531002a029eaba6be60f32ad9da85 (diff)
parentec44803109910127657b214f4556651a9619430d (diff)
downloadQt-40d8ec7118d5f39acec3f71d33a87f0483bd2b2b.zip
Qt-40d8ec7118d5f39acec3f71d33a87f0483bd2b2b.tar.gz
Qt-40d8ec7118d5f39acec3f71d33a87f0483bd2b2b.tar.bz2
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src/gui/image/qpixmap_raster.cpp')
-rw-r--r--src/gui/image/qpixmap_raster.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 53f3559..29bf5f5 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -44,11 +44,13 @@
#include "qpixmap_raster_p.h"
#include "qnativeimage_p.h"
#include "qimage_p.h"
+#include "qpaintengine.h"
#include "qbitmap.h"
#include "qimage.h"
#include <QBuffer>
#include <QImageReader>
+#include <private/qimage_p.h>
#include <private/qsimd_p.h>
#include <private/qwidget_p.h>
#include <private/qdrawhelper_p.h>
@@ -302,6 +304,15 @@ bool QRasterPixmapData::hasAlphaChannel() const
QImage QRasterPixmapData::toImage() const
{
+ if (!image.isNull()) {
+ QImageData *data = const_cast<QImage &>(image).data_ptr();
+ if (data->paintEngine && data->paintEngine->isActive()
+ && data->paintEngine->paintDevice() == &image)
+ {
+ return image.copy();
+ }
+ }
+
return image;
}