diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2015-02-25 15:38:42 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2015-02-28 16:28:54 +0000 |
commit | 66fc1e35db664ecaf0b37c855eea7391c0576773 (patch) | |
tree | cb805d9a294c40fb9a08cc985ee41366e962f20e /src/core/nodes/qcomponent.cpp | |
parent | 653ff3d4d5f992b64c4949e9741f4213a81a9f42 (diff) |
ChangeArbiter/SceneChange: use id as change subject
Instead of having a QNode* or QObservable as the subject of a change, we use
it's unique NodeId instead. That will prevent the ChangeArbiter from trying to
distribute changes by looking at a QNode/QObservable id when the
QNode/QObservable might have been destroyed in the meantime.
Change-Id: Ia419d5b841434fd65522c8c65de552089cfe97cf
Task-number: QTBUG-44628
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/core/nodes/qcomponent.cpp')
-rw-r--r-- | src/core/nodes/qcomponent.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/nodes/qcomponent.cpp b/src/core/nodes/qcomponent.cpp index a05b9980b..2827db9f9 100644 --- a/src/core/nodes/qcomponent.cpp +++ b/src/core/nodes/qcomponent.cpp @@ -59,7 +59,7 @@ void QComponentPrivate::addEntity(QEntity *entity) // We notify only if we have a QChangeArbiter if (m_changeArbiter != Q_NULLPTR) { Q_Q(QComponent); - QScenePropertyChangePtr e(new QScenePropertyChange(ComponentAdded, q)); + QScenePropertyChangePtr e(new QScenePropertyChange(ComponentAdded, QSceneChange::Node, q->id())); e->setPropertyName("entity"); e->setValue(QVariant::fromValue(entity->id())); notifyObservers(e); @@ -71,7 +71,7 @@ void QComponentPrivate::removeEntity(QEntity *entity) // We notify only if we have a QChangeArbiter if (m_changeArbiter != Q_NULLPTR) { Q_Q(QComponent); - QScenePropertyChangePtr e(new QScenePropertyChange(ComponentRemoved, q)); + QScenePropertyChangePtr e(new QScenePropertyChange(ComponentRemoved, QSceneChange::Node, q->id())); e->setPropertyName("entity"); e->setValue(QVariant::fromValue(entity->id())); notifyObservers(e); |