diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2010-12-09 01:10:54 (GMT) |
---|---|---|
committer | Joona Petrell <joona.t.petrell@nokia.com> | 2010-12-09 01:10:54 (GMT) |
commit | 6efa3aa2fb9694e3275fac7412f9f930c715c628 (patch) | |
tree | c6ac25ee98e0b1438385efe8bcbf435b9c0ed25a /src/gui/image/qimage.cpp | |
parent | 58ae252e5555dc379b4ed500532bc51ff7bebc25 (diff) | |
parent | ec44803109910127657b214f4556651a9619430d (diff) | |
download | Qt-6efa3aa2fb9694e3275fac7412f9f930c715c628.zip Qt-6efa3aa2fb9694e3275fac7412f9f930c715c628.tar.gz Qt-6efa3aa2fb9694e3275fac7412f9f930c715c628.tar.bz2 |
Merge qtsoftware:qt/qt.git#4.7 into qtsoftware:qt/qt-qml.git#4.7
Conflicts:
src/s60installs/eabi/QtGuiu.def
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; } |