From c235e347b53500b6534a3e2c1cacc05d7160f98f Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 6 Sep 2010 12:30:29 +1000 Subject: 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 --- src/declarative/graphicsitems/qdeclarativeimagebase.cpp | 11 ++++++----- 1 file 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(); } -- cgit v0.12