summaryrefslogtreecommitdiff
path: root/src/gui/image
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-01-08 11:17:52 +0100
committerQt Continuous Integration System <qt-info@nokia.com>2010-01-08 11:17:52 +0100
commit4596db451cd2c53768e42b00a4234e7de2149f39 (patch)
tree4250d4ecda16797ecacedf8e6df6408fb27e7fa6 /src/gui/image
parent118e7a807d0764dee97612589fe5d7072d271e1e (diff)
parent1484008e831a6b18272babb17992c4de686da045 (diff)
downloadqt4-tools-4596db451cd2c53768e42b00a4234e7de2149f39.tar.gz
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Make sure the rect in QPixmap::copy() doesn't exceed the boundingRect. Fix a painter warning
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qpixmap.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 7e4597e052..7b522f58f5 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -357,7 +357,9 @@ QPixmap QPixmap::copy(const QRect &rect) const
if (isNull())
return QPixmap();
- const QRect r = rect.isEmpty() ? QRect(0, 0, width(), height()) : rect;
+ QRect r(0, 0, width(), height());
+ if (!rect.isEmpty())
+ r = r.intersected(rect);
QPixmapData *d = data->createCompatiblePixmapData();
d->copy(data.data(), r);