summaryrefslogtreecommitdiffstats
path: root/src/core/qscenechange.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-02-25 15:38:42 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-02-28 16:28:54 +0000
commit66fc1e35db664ecaf0b37c855eea7391c0576773 (patch)
treecb805d9a294c40fb9a08cc985ee41366e962f20e /src/core/qscenechange.h
parent653ff3d4d5f992b64c4949e9741f4213a81a9f42 (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/qscenechange.h')
-rw-r--r--src/core/qscenechange.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/core/qscenechange.h b/src/core/qscenechange.h
index f52871b67..3c22638d3 100644
--- a/src/core/qscenechange.h
+++ b/src/core/qscenechange.h
@@ -39,6 +39,7 @@
#include <Qt3DCore/qt3dcore_global.h>
#include <QSharedPointer>
+#include <Qt3DCore/qnodeid.h>
QT_BEGIN_NAMESPACE
@@ -76,27 +77,20 @@ public:
Node
};
- union SubjectUnion {
- QObservableInterface *m_observable;
- QNode *m_node;
- };
-
- QSceneChange(ChangeFlag type, QObservableInterface *observable, Priority priority = Standard);
- QSceneChange(ChangeFlag type, QNode *node, Priority priority = Standard);
+ QSceneChange(ChangeFlag type, ObservableType observableType, const QNodeId &subjectId, Priority priority = Standard);
virtual ~QSceneChange();
ChangeFlag type() const;
qint64 timestamp() const;
QSceneChange::Priority priority() const;
QSceneChange::ObservableType observableType() const;
- QSceneChange::SubjectUnion subject() const;
+ QNodeId subjectId() const;
protected:
Q_DECLARE_PRIVATE(QSceneChange)
QSceneChangePrivate *d_ptr;
QSceneChange(QSceneChangePrivate &dd);
- QSceneChange(QSceneChangePrivate &dd, ChangeFlag type, QObservableInterface *observable, Priority priority = Standard);
- QSceneChange(QSceneChangePrivate &dd, ChangeFlag type, QNode *node, Priority priority = Standard);
+ QSceneChange(QSceneChangePrivate &dd, ChangeFlag type, ObservableType observableType, const QNodeId &subjectId, Priority priority = Standard);
// TODO: add timestamp from central clock and priority level
// These can be used to resolve any conflicts between events