summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-08 06:03:22 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-02-08 06:03:22 (GMT)
commitd4b1468b323b2ded430243e66da63523193de9ce (patch)
treebcdd30535624bd57789ebdd75fd8e04cdea079f4 /src/declarative/graphicsitems
parente95c8551062fc79ea9b4f53bf68f13cb0afcbeb6 (diff)
parentfd2463dcde5d921bccdbaddf25e33574affbd41f (diff)
downloadQt-d4b1468b323b2ded430243e66da63523193de9ce.zip
Qt-d4b1468b323b2ded430243e66da63523193de9ce.tar.gz
Qt-d4b1468b323b2ded430243e66da63523193de9ce.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsimage.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsimage.cpp b/src/declarative/graphicsitems/qmlgraphicsimage.cpp
index a1e8c17..7e63c8b 100644
--- a/src/declarative/graphicsitems/qmlgraphicsimage.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsimage.cpp
@@ -126,13 +126,13 @@ QML_DEFINE_TYPE(Qt,4,6,Image,QmlGraphicsImage)
*/
QmlGraphicsImage::QmlGraphicsImage(QmlGraphicsItem *parent)
- : QmlGraphicsImageBase(*(new QmlGraphicsImagePrivate), parent)
+ : QmlGraphicsImageBase(*(new QmlGraphicsImagePrivate), parent)
{
connect(this, SIGNAL(sourceChanged(QUrl)), this, SLOT(updatePaintedGeometry()));
}
QmlGraphicsImage::QmlGraphicsImage(QmlGraphicsImagePrivate &dd, QmlGraphicsItem *parent)
- : QmlGraphicsImageBase(dd, parent)
+ : QmlGraphicsImageBase(dd, parent)
{
}
@@ -343,12 +343,18 @@ void QmlGraphicsImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWid
scale.translate(0, (height() - heightScale * d->pix.height()) / 2);
}
}
-
+ if (clip()) {
+ p->save();
+ p->setClipRect(boundingRect(), Qt::IntersectClip);
+ }
scale.scale(widthScale, heightScale);
QTransform old = p->transform();
p->setWorldTransform(scale * old);
p->drawPixmap(0, 0, d->pix);
p->setWorldTransform(old);
+ if (clip()) {
+ p->restore();
+ }
}
} else {
p->drawPixmap(0, 0, d->pix);