diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-06-19 01:08:08 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-06-19 01:08:08 (GMT) |
commit | 2164656f4f010950d38de65ee826520c66d15180 (patch) | |
tree | c138a594c08fb9fb279dc74fa716c15047c7eaae /src/declarative/fx/qfximage.cpp | |
parent | 9c7c859647771d5d2fa466b0a3ff9d408edecd38 (diff) | |
download | Qt-2164656f4f010950d38de65ee826520c66d15180.zip Qt-2164656f4f010950d38de65ee826520c66d15180.tar.gz Qt-2164656f4f010950d38de65ee826520c66d15180.tar.bz2 |
Ensure image loads are cencelled if item destroyed.
(most obvious when item is in a delegate)
Diffstat (limited to 'src/declarative/fx/qfximage.cpp')
-rw-r--r-- | src/declarative/fx/qfximage.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp index 05738e3..40389c4 100644 --- a/src/declarative/fx/qfximage.cpp +++ b/src/declarative/fx/qfximage.cpp @@ -127,6 +127,10 @@ QFxImage::~QFxImage() Q_D(QFxImage); if (d->sciReply) d->sciReply->deleteLater(); + if (!d->url.isEmpty()) + QFxPixmap::cancelGet(d->url, this); + if (!d->sciurl.isEmpty()) + QFxPixmap::cancelGet(d->sciurl, this); #if defined(QFX_RENDER_OPENGL) if (d->tex) { d->tex->release(); @@ -972,6 +976,13 @@ void QFxImage::setGridScaledImage(const QFxGridScaledImage& sci) d->status = Error; emit statusChanged(d->status); } else { + QFxScaleGrid *sg = scaleGrid(); + sg->setTop(sci.gridTop()); + sg->setBottom(sci.gridBottom()); + sg->setLeft(sci.gridLeft()); + sg->setRight(sci.gridRight()); + setOptions(QFxImage::SimpleItem, false); + d->sciurl = d->url.resolved(QUrl(sci.pixmapUrl())); d->reply = QFxPixmap::get(qmlEngine(this), d->sciurl, this, SLOT(requestFinished())); if (d->reply) { @@ -981,12 +992,6 @@ void QFxImage::setGridScaledImage(const QFxGridScaledImage& sci) d->progress = 1.0; emit progressChanged(d->progress); } - QFxScaleGrid *sg = scaleGrid(); - sg->setTop(sci.gridTop()); - sg->setBottom(sci.gridBottom()); - sg->setLeft(sci.gridLeft()); - sg->setRight(sci.gridRight()); - setOptions(QFxImage::SimpleItem, false); } } |