diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-07-25 15:12:17 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-28 08:39:33 +0200 |
commit | 02bf8f421d32ef7449b0fe2fe1ad62fea33bcc61 (patch) | |
tree | fc89fff09bb3a10d9b5f0e385144c67d876f09e2 /src/declarative/particles/qsgmodelparticle.cpp | |
parent | d197b2d2cdb8787456cc9b7da27b7400e3b7a159 (diff) |
Manage m_activeCount centrally
Fixes issue where it wasn't being managed right and kept going negative.
This commit also adds setVisible in a few places missed by the last
change.
Task-number: QTBUG-20437
Change-Id: I4efaab7b34784dfbc42dd1acd0a5be3b38a8605a
Reviewed-on: http://codereview.qt.nokia.com/2074
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'src/declarative/particles/qsgmodelparticle.cpp')
-rw-r--r-- | src/declarative/particles/qsgmodelparticle.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/declarative/particles/qsgmodelparticle.cpp b/src/declarative/particles/qsgmodelparticle.cpp index 08646e32ae..19815aa8f4 100644 --- a/src/declarative/particles/qsgmodelparticle.cpp +++ b/src/declarative/particles/qsgmodelparticle.cpp @@ -171,7 +171,6 @@ void QSGModelParticle::initialize(int gIdx, int pIdx) if (m_available.isEmpty()) return; m_requests << m_system->m_groupData[gIdx]->data[pIdx]; - m_activeCount++; } void QSGModelParticle::processPending() @@ -181,6 +180,7 @@ void QSGModelParticle::processPending() if (m_fade) item->setOpacity(0.); m_model->release(item); + m_activeCount--; } m_deletables.clear(); @@ -193,7 +193,6 @@ void QSGModelParticle::processPending() m_available << datum->modelIndex; datum->modelIndex = -1; datum->delegate = 0; - m_activeCount--; } if (!m_available.isEmpty()){ @@ -206,7 +205,10 @@ void QSGModelParticle::processPending() mpa->attach(); } datum->delegate->setParentItem(this); - datum->delegate->setOpacity(0.0); + if (m_fade) + datum->delegate->setOpacity(0.0); + datum->delegate->setVisible(false);//Will be set to true when we prepare the next frame + m_activeCount++; } } m_requests.clear(); @@ -271,7 +273,6 @@ void QSGModelParticle::prepareNextFrame() m_deletables << data->delegate; data->modelIndex = -1; data->delegate = 0; - m_activeCount--; continue; }else{//Fade data->delegate->setVisible(true); |