summaryrefslogtreecommitdiffstats
path: root/src/declarative/extra
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-08-26 22:28:51 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-08-26 22:28:51 (GMT)
commit79d5daab124e98880fe0847c19cad4def672870b (patch)
tree5ee921766615e73250c73b828f87def462387ccd /src/declarative/extra
parentaae8756e9f120ecec13e029873aa8402dea04116 (diff)
parent3d33fb250c4d23b746124b8d1f1a974cdacb48e6 (diff)
downloadQt-79d5daab124e98880fe0847c19cad4def672870b.zip
Qt-79d5daab124e98880fe0847c19cad4def672870b.tar.gz
Qt-79d5daab124e98880fe0847c19cad4def672870b.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/extra')
-rw-r--r--src/declarative/extra/qfxanimatedimageitem.h2
-rw-r--r--src/declarative/extra/qfxparticles.cpp16
-rw-r--r--src/declarative/extra/qfxparticles.h2
3 files changed, 13 insertions, 7 deletions
diff --git a/src/declarative/extra/qfxanimatedimageitem.h b/src/declarative/extra/qfxanimatedimageitem.h
index 2d531ee..4002a3f 100644
--- a/src/declarative/extra/qfxanimatedimageitem.h
+++ b/src/declarative/extra/qfxanimatedimageitem.h
@@ -94,7 +94,7 @@ protected:
private:
Q_DISABLE_COPY(QFxAnimatedImageItem)
- Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr, QFxAnimatedImageItem)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QFxAnimatedImageItem)
};
QT_END_NAMESPACE
diff --git a/src/declarative/extra/qfxparticles.cpp b/src/declarative/extra/qfxparticles.cpp
index ec15099..7855f3e 100644
--- a/src/declarative/extra/qfxparticles.cpp
+++ b/src/declarative/extra/qfxparticles.cpp
@@ -368,7 +368,7 @@ public:
: count(1), lifeSpan(1000), lifeSpanDev(1000), fadeInDur(200), fadeOutDur(300)
, angle(0), angleDev(0), velocity(0), velocityDev(0)
, addParticleTime(0), addParticleCount(0), lastAdvTime(0), stream(false), streamDelay(0)
- , emitting(true), motion(0), clock(this)
+ , emitting(true), motion(0), pendingPixmapCache(false), clock(this)
{
}
@@ -406,6 +406,8 @@ public:
QFxParticleMotion *motion;
QFxParticlesPainter *paintItem;
+ bool pendingPixmapCache;
+
QList<QFxParticle> particles;
QTickAnimationProxy<QFxParticlesPrivate, &QFxParticlesPrivate::tick> clock;
@@ -615,7 +617,7 @@ QFxParticles::QFxParticles(QFxParticlesPrivate &dd, QFxItem *parent)
QFxParticles::~QFxParticles()
{
Q_D(QFxParticles);
- if (!d->url.isEmpty())
+ if (d->pendingPixmapCache)
QFxPixmapCache::cancelGet(d->url, this);
}
@@ -637,6 +639,7 @@ QUrl QFxParticles::source() const
void QFxParticles::imageLoaded()
{
Q_D(QFxParticles);
+ d->pendingPixmapCache = false;
QFxPixmapCache::find(d->url, &d->image);
d->paintItem->updateSize();
d->paintItem->update();
@@ -649,8 +652,10 @@ void QFxParticles::setSource(const QUrl &name)
if ((d->url.isEmpty() == name.isEmpty()) && name == d->url)
return;
- if (!d->url.isEmpty())
+ if (d->pendingPixmapCache) {
QFxPixmapCache::cancelGet(d->url, this);
+ d->pendingPixmapCache = false;
+ }
if (name.isEmpty()) {
d->url = name;
d->image = QPixmap();
@@ -660,9 +665,10 @@ void QFxParticles::setSource(const QUrl &name)
d->url = name;
Q_ASSERT(!name.isRelative());
QNetworkReply *reply = QFxPixmapCache::get(qmlEngine(this), d->url, &d->image);
- if (reply)
+ if (reply) {
connect(reply, SIGNAL(finished()), this, SLOT(imageLoaded()));
- else {
+ d->pendingPixmapCache = true;
+ } else {
//### unify with imageLoaded
d->paintItem->updateSize();
d->paintItem->update();
diff --git a/src/declarative/extra/qfxparticles.h b/src/declarative/extra/qfxparticles.h
index bde6ec6..959c518 100644
--- a/src/declarative/extra/qfxparticles.h
+++ b/src/declarative/extra/qfxparticles.h
@@ -214,7 +214,7 @@ private Q_SLOTS:
private:
Q_DISABLE_COPY(QFxParticles)
- Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr, QFxParticles)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QFxParticles)
};
QT_END_NAMESPACE