diff options
Diffstat (limited to 'src/core/changes')
-rw-r--r-- | src/core/changes/qcomponentaddedchange.cpp | 12 | ||||
-rw-r--r-- | src/core/changes/qcomponentaddedchange.h | 2 | ||||
-rw-r--r-- | src/core/changes/qcomponentremovedchange.cpp | 13 | ||||
-rw-r--r-- | src/core/changes/qcomponentremovedchange.h | 2 |
4 files changed, 27 insertions, 2 deletions
diff --git a/src/core/changes/qcomponentaddedchange.cpp b/src/core/changes/qcomponentaddedchange.cpp index e00c4ffab..41f7a2340 100644 --- a/src/core/changes/qcomponentaddedchange.cpp +++ b/src/core/changes/qcomponentaddedchange.cpp @@ -75,7 +75,7 @@ QComponentAddedChangePrivate::QComponentAddedChangePrivate(const QEntity *entity */ /*! - * Constructs a new QComponentAddedChange with with \a entity and \a component. + * Constructs a new QComponentAddedChange which will notify \a entity that \a component was added */ QComponentAddedChange::QComponentAddedChange(const QEntity *entity, const QComponent *component) @@ -84,6 +84,16 @@ QComponentAddedChange::QComponentAddedChange(const QEntity *entity, { } +/*! + * Constructs a new QComponentAddedChange which will notify \a component that it was added to \a entity + */ +QComponentAddedChange::QComponentAddedChange(const QComponent *component, + const QEntity *entity) + : QSceneChange(*new QComponentAddedChangePrivate(entity, component), + ComponentAdded, component->id()) +{ +} + QComponentAddedChange::~QComponentAddedChange() { } diff --git a/src/core/changes/qcomponentaddedchange.h b/src/core/changes/qcomponentaddedchange.h index a62cac116..e7676a026 100644 --- a/src/core/changes/qcomponentaddedchange.h +++ b/src/core/changes/qcomponentaddedchange.h @@ -55,6 +55,8 @@ class QT3DCORESHARED_EXPORT QComponentAddedChange : public QSceneChange public: explicit QComponentAddedChange(const QEntity *entity, const QComponent *component); + explicit QComponentAddedChange(const QComponent *component, + const QEntity *entity); ~QComponentAddedChange(); QNodeId entityId() const Q_DECL_NOTHROW; diff --git a/src/core/changes/qcomponentremovedchange.cpp b/src/core/changes/qcomponentremovedchange.cpp index 5e5dfa5aa..e2129169a 100644 --- a/src/core/changes/qcomponentremovedchange.cpp +++ b/src/core/changes/qcomponentremovedchange.cpp @@ -75,7 +75,7 @@ QComponentRemovedChangePrivate::QComponentRemovedChangePrivate(const QEntity *en */ /*! - * Constructs a new QComponentRemovedChange with \a entity and \a component. + * Constructs a new QComponentRemovedChange which will notify \a entity that \a component was removed. */ QComponentRemovedChange::QComponentRemovedChange(const QEntity *entity, const QComponent *component) @@ -84,6 +84,17 @@ QComponentRemovedChange::QComponentRemovedChange(const QEntity *entity, { } +/*! + * Constructs a new QComponentRemovedChange which will notify \a component that it was removed from \a entity + */ +QComponentRemovedChange::QComponentRemovedChange(const QComponent *component, + const QEntity *entity) + : QSceneChange(*new QComponentRemovedChangePrivate(entity, component), + ComponentRemoved, component->id()) +{ + +} + QComponentRemovedChange::~QComponentRemovedChange() { } diff --git a/src/core/changes/qcomponentremovedchange.h b/src/core/changes/qcomponentremovedchange.h index 3c57fe26f..66743b1ae 100644 --- a/src/core/changes/qcomponentremovedchange.h +++ b/src/core/changes/qcomponentremovedchange.h @@ -55,6 +55,8 @@ class QT3DCORESHARED_EXPORT QComponentRemovedChange : public QSceneChange public: explicit QComponentRemovedChange(const QEntity *entity, const QComponent *component); + explicit QComponentRemovedChange(const QComponent *component, + const QEntity *entity); ~QComponentRemovedChange(); QNodeId entityId() const Q_DECL_NOTHROW; |