summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-09-06 02:30:29 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-09-06 02:30:29 (GMT)
commitc235e347b53500b6534a3e2c1cacc05d7160f98f (patch)
tree9a3a1e01ac57e1f8dd826fdb8bc0f81374cd8622 /src
parentc3bf669fb7fdac530365f36750613f2e21893a77 (diff)
downloadQt-c235e347b53500b6534a3e2c1cacc05d7160f98f.zip
Qt-c235e347b53500b6534a3e2c1cacc05d7160f98f.tar.gz
Qt-c235e347b53500b6534a3e2c1cacc05d7160f98f.tar.bz2
Ensure all image state is updated before emitting changed signals.
statusChanged() was emitted before the size was set, so if you did, e.g. if (width != 0) in onStatusChanged it would get the wrong width. Task-number: QT-3820 Reviewed-by: Yann Bodson
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
index 416604b..482906e 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -139,9 +139,9 @@ void QDeclarativeImageBase::load()
d->status = Null;
setImplicitWidth(0);
setImplicitHeight(0);
- emit statusChanged(d->status);
d->sourcesize.setWidth(0);
d->sourcesize.setHeight(0);
+ emit statusChanged(d->status);
emit sourceSizeChanged();
pixmapChange();
update();
@@ -182,19 +182,20 @@ void QDeclarativeImageBase::requestFinished()
} else {
d->status = Ready;
}
- emit statusChanged(d->status);
+
+ d->progress = 1.0;
setImplicitWidth(d->pix.width());
setImplicitHeight(d->pix.height());
- d->progress = 1.0;
- emit progressChanged(d->progress);
-
if (d->sourcesize.width() != d->pix.width() || d->sourcesize.height() != d->pix.height()) {
d->sourcesize.setWidth(d->pix.width());
d->sourcesize.setHeight(d->pix.height());
emit sourceSizeChanged();
}
+
+ emit statusChanged(d->status);
+ emit progressChanged(d->progress);
pixmapChange();
update();
}