diff options
author | Geir Vattekar <geir.vattekar@nokia.com> | 2010-12-09 11:43:04 (GMT) |
---|---|---|
committer | Geir Vattekar <geir.vattekar@nokia.com> | 2010-12-09 11:43:04 (GMT) |
commit | 3b20e58b9494549713b492e35af6531b4bc179c9 (patch) | |
tree | 9ae3fb2e2d02a78f6f2fe36adaad364170fd704c /src/gui/image/qimage.cpp | |
parent | bd4ac06eb3c8ac3a9044689481873ce91aeb3180 (diff) | |
parent | 91518478d32a5d5ce188b02f92e744fc782dd687 (diff) | |
download | Qt-3b20e58b9494549713b492e35af6531b4bc179c9.zip Qt-3b20e58b9494549713b492e35af6531b4bc179c9.tar.gz Qt-3b20e58b9494549713b492e35af6531b4bc179c9.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r-- | src/gui/image/qimage.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 1157b93..6ba3858 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -1121,9 +1121,14 @@ QImage::QImage(const char * const xpm[]) QImage::QImage(const QImage &image) : QPaintDevice() { - d = image.d; - if (d) - d->ref.ref(); + if (image.paintingActive()) { + d = 0; + operator=(image.copy()); + } else { + d = image.d; + if (d) + d->ref.ref(); + } } #ifdef QT3_SUPPORT @@ -1320,11 +1325,15 @@ QImage::~QImage() QImage &QImage::operator=(const QImage &image) { - if (image.d) - image.d->ref.ref(); - if (d && !d->ref.deref()) - delete d; - d = image.d; + if (image.paintingActive()) { + operator=(image.copy()); + } else { + if (image.d) + image.d->ref.ref(); + if (d && !d->ref.deref()) + delete d; + d = image.d; + } return *this; } |