diff options
author | David Boddie <david.boddie@nokia.com> | 2010-12-15 13:16:24 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2010-12-15 13:16:24 (GMT) |
commit | 1c1d3e79e1b7cb2cdffaee38a98bc777e3a7b961 (patch) | |
tree | 5c33473950b22db0a0eb9c230005cd8e7f251538 /src/gui/image/qimage.cpp | |
parent | cace8e6a9f00ee478dfe63a7fa6959056cfe7e8a (diff) | |
parent | 0c6780c39d18a4fd06b9bed94400de365a518c45 (diff) | |
download | Qt-1c1d3e79e1b7cb2cdffaee38a98bc777e3a7b961.zip Qt-1c1d3e79e1b7cb2cdffaee38a98bc777e3a7b961.tar.gz Qt-1c1d3e79e1b7cb2cdffaee38a98bc777e3a7b961.tar.bz2 |
Merge branch '4.7' into mimir
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 2bb0897..cc3b867 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; } |