diff options
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()); |