aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-07-25 15:07:42 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-25 08:02:29 +0200
commit4453c2c0aea512f56da5a2ba0ac55b1bbd59cb35 (patch)
tree1d264b2313f38553b4b6a27a12516fe40069e608 /src/declarative
parentc500bd41751ca253fe40868fe54557749736d109 (diff)
Only manage opacity when m_fade is true
In all cases, visualize lifecycle with 'visible' property instead. Task-number: QTBUG-20438 Change-Id: Ib0b732708e14ad043c5b673205eaec0467e38174 Reviewed-on: http://codereview.qt.nokia.com/2071 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/particles/qsgitemparticle.cpp4
-rw-r--r--src/declarative/particles/qsgmodelparticle.cpp7
2 files changed, 6 insertions, 5 deletions
diff --git a/src/declarative/particles/qsgitemparticle.cpp b/src/declarative/particles/qsgitemparticle.cpp
index 1d2d166242..878e04d453 100644
--- a/src/declarative/particles/qsgitemparticle.cpp
+++ b/src/declarative/particles/qsgitemparticle.cpp
@@ -108,6 +108,7 @@ void QSGItemParticle::tick()
foreach (QSGItem* item, m_deletables){
if (m_fade)
item->setOpacity(0.);
+ item->setVisible(false);
QSGItemParticleAttached* mpa;
if ((mpa = qobject_cast<QSGItemParticleAttached*>(qmlAttachedPropertiesObject<QSGItemParticle>(item))))
mpa->detach();//reparent as well?
@@ -203,6 +204,7 @@ void QSGItemParticle::prepareNextFrame()
data->delegate = 0;
m_activeCount--;
}else{//Fade
+ data->delegate->setVisible(true);
if (m_fade){
qreal o = 1.;
if (t<0.2)
@@ -210,8 +212,6 @@ void QSGItemParticle::prepareNextFrame()
if (t>0.8)
o = (1-t)*5;
item->setOpacity(o);
- }else{
- item->setOpacity(1.);//###Without fade, it's just a binary toggle - if we turn it off we have to turn it back on
}
}
item->setX(data->curX() - item->width()/2 - m_systemOffset.x());
diff --git a/src/declarative/particles/qsgmodelparticle.cpp b/src/declarative/particles/qsgmodelparticle.cpp
index 844b76dcb2..cb295d6717 100644
--- a/src/declarative/particles/qsgmodelparticle.cpp
+++ b/src/declarative/particles/qsgmodelparticle.cpp
@@ -171,7 +171,9 @@ void QSGModelParticle::initialize(int gIdx, int pIdx)
void QSGModelParticle::processPending()
{//can't create/delete arbitrary items in the render thread
foreach (QSGItem* item, m_deletables){
- item->setOpacity(0.);
+ item->setVisible(false);
+ if (m_fade)
+ item->setOpacity(0.);
m_model->release(item);
}
m_deletables.clear();
@@ -267,6 +269,7 @@ void QSGModelParticle::prepareNextFrame()
m_activeCount--;
continue;
}else{//Fade
+ data->delegate->setVisible(true);
if (m_fade){
qreal o = 1.;
if (t<0.2)
@@ -274,8 +277,6 @@ void QSGModelParticle::prepareNextFrame()
if (t>0.8)
o = (1-t)*5;
data->delegate->setOpacity(o);
- }else{
- data->delegate->setOpacity(1.);//###Without fade, it's just a binary toggle - if we turn it off we have to turn it back on
}
}
data->delegate->setX(data->curX() - data->delegate->width()/2 - m_systemOffset.x());