summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-04-06 05:46:35 (GMT)
committerMartin Jones <martin.jones@nokia.com>2011-04-07 03:47:36 (GMT)
commit051a76c1d65d698f71dc75c89f91ae9021357eae (patch)
tree3a5120fc40ef877014deba478bdf5ad67c0acaf8 /src/declarative/graphicsitems/qdeclarativeimagebase.cpp
parent5f741649cff218367100f3a9d7cdf9e0d393e327 (diff)
downloadQt-051a76c1d65d698f71dc75c89f91ae9021357eae.zip
Qt-051a76c1d65d698f71dc75c89f91ae9021357eae.tar.gz
Qt-051a76c1d65d698f71dc75c89f91ae9021357eae.tar.bz2
Image w/ PreserveAspectFit has its width changed once more than needed.
Avoid an extra setImplicitWidth/setImplicitHeight on image load. Change-Id: I8bec1c97244068000c7a7f5fb3e937f80f3b36f5 Task-number: QTBUG-18573 Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeimagebase.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
index daebac4..81eac78 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -191,11 +191,9 @@ void QDeclarativeImageBase::load()
d->pix.clear(this);
d->status = Null;
d->progress = 0.0;
- setImplicitWidth(0);
- setImplicitHeight(0);
+ pixmapChange();
emit progressChanged(d->progress);
emit statusChanged(d->status);
- pixmapChange();
update();
} else {
QDeclarativePixmap::Options options;
@@ -246,8 +244,7 @@ void QDeclarativeImageBase::requestFinished()
d->progress = 1.0;
- setImplicitWidth(d->pix.width());
- setImplicitHeight(d->pix.height());
+ pixmapChange();
if (d->sourcesize.width() != d->pix.width() || d->sourcesize.height() != d->pix.height())
emit sourceSizeChanged();
@@ -256,7 +253,7 @@ void QDeclarativeImageBase::requestFinished()
emit statusChanged(d->status);
if (d->progress != oldProgress)
emit progressChanged(d->progress);
- pixmapChange();
+
update();
}
@@ -279,6 +276,9 @@ void QDeclarativeImageBase::componentComplete()
void QDeclarativeImageBase::pixmapChange()
{
+ Q_D(QDeclarativeImageBase);
+ setImplicitWidth(d->pix.width());
+ setImplicitHeight(d->pix.height());
}
QT_END_NAMESPACE