summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeimagebase.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
index 2de3ba0..daebac4 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -133,6 +133,18 @@ QSize QDeclarativeImageBase::sourceSize() const
return QSize(width != -1 ? width : d->pix.width(), height != -1 ? height : d->pix.height());
}
+void QDeclarativeImageBase::resetSourceSize()
+{
+ Q_D(QDeclarativeImageBase);
+ if (!d->explicitSourceSize)
+ return;
+ d->explicitSourceSize = false;
+ d->sourcesize = QSize();
+ emit sourceSizeChanged();
+ if (isComponentComplete())
+ load();
+}
+
bool QDeclarativeImageBase::cache() const
{
Q_D(const QDeclarativeImageBase);
@@ -176,7 +188,7 @@ void QDeclarativeImageBase::load()
Q_D(QDeclarativeImageBase);
if (d->url.isEmpty()) {
- d->pix.clear();
+ d->pix.clear(this);
d->status = Null;
d->progress = 0.0;
setImplicitWidth(0);
@@ -191,6 +203,7 @@ void QDeclarativeImageBase::load()
options |= QDeclarativePixmap::Asynchronous;
if (d->cache)
options |= QDeclarativePixmap::Cache;
+ d->pix.clear(this);
d->pix.load(qmlEngine(this), d->url, d->explicitSourceSize ? sourceSize() : QSize(), options);
if (d->pix.isLoading()) {