diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2010-02-26 06:29:43 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2010-02-26 06:29:43 (GMT) |
commit | 1156821731078b0f0b31066632de091754bc6d52 (patch) | |
tree | c36ad794d4d76145c180f3f5a35222ec235214c7 /src/declarative/graphicsitems/qdeclarativeimage.cpp | |
parent | 4c26e112f59d6f5305717b70886b845bc904b889 (diff) | |
download | Qt-1156821731078b0f0b31066632de091754bc6d52.zip Qt-1156821731078b0f0b31066632de091754bc6d52.tar.gz Qt-1156821731078b0f0b31066632de091754bc6d52.tar.bz2 |
update painted geometry on pixmapChanged rather than sourceChanged
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeimage.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeimage.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index 338b086..99ab053 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -127,7 +127,7 @@ QT_BEGIN_NAMESPACE QDeclarativeImage::QDeclarativeImage(QDeclarativeItem *parent) : QDeclarativeImageBase(*(new QDeclarativeImagePrivate), parent) { - connect(this, SIGNAL(sourceChanged(QUrl)), this, SLOT(updatePaintedGeometry())); + connect(this, SIGNAL(pixmapChanged()), this, SLOT(updatePaintedGeometry())); } QDeclarativeImage::QDeclarativeImage(QDeclarativeImagePrivate &dd, QDeclarativeItem *parent) @@ -139,12 +139,6 @@ QDeclarativeImage::~QDeclarativeImage() { } -void QDeclarativeImage::setSource(const QUrl &url) -{ - QDeclarativeImageBase::setSource(url); - updatePaintedGeometry(); -} - /*! \qmlproperty QPixmap Image::pixmap @@ -268,10 +262,10 @@ void QDeclarativeImage::updatePaintedGeometry() Q_D(QDeclarativeImage); if (d->fillMode == PreserveAspectFit) { - qreal widthScale = width() / qreal(d->pix.width()); - qreal heightScale = height() / qreal(d->pix.height()); if (!d->pix.width() || !d->pix.height()) return; + qreal widthScale = width() / qreal(d->pix.width()); + qreal heightScale = height() / qreal(d->pix.height()); if (widthScale <= heightScale) { d->paintedWidth = width(); d->paintedHeight = widthScale * qreal(d->pix.height()); |