diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2014-10-02 09:57:56 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-10-03 21:18:56 +0200 |
commit | 7e8d0d9e72ee231d45008cce447f342980de9405 (patch) | |
tree | 49cb06c83e6ab70b886a3cf8a38290f00796e9d1 /src/core/nodes/qcomponent.cpp | |
parent | 3f20529e605eac75f416931c5c96ea03efa0c3ce (diff) |
QComponent shareable property
Task-number: QTBUG-41524
Change-Id: I3851064c01165e49a872ec568c86337c653e6a86
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/core/nodes/qcomponent.cpp')
-rw-r--r-- | src/core/nodes/qcomponent.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/nodes/qcomponent.cpp b/src/core/nodes/qcomponent.cpp index 27aa1da37..e59f89ea4 100644 --- a/src/core/nodes/qcomponent.cpp +++ b/src/core/nodes/qcomponent.cpp @@ -42,12 +42,15 @@ #include "qcomponent.h" #include "qcomponent_p.h" +#include <Qt3DCore/qscenepropertychange.h> + QT_BEGIN_NAMESPACE namespace Qt3D { QComponentPrivate::QComponentPrivate(QComponent *qq) : QNodePrivate(qq) + , m_shareable(true) { } @@ -56,6 +59,28 @@ QComponent::QComponent(QNode *parent) { } +bool QComponent::shareable() const +{ + Q_D(const QComponent); + return d->m_shareable; +} + +void QComponent::setShareable(bool shareable) +{ + Q_D(QComponent); + if (d->m_shareable != shareable) { + d->m_shareable = shareable; + emit shareableChanged(); + + if (d->m_changeArbiter != Q_NULLPTR) { + QScenePropertyChangePtr propertyChange(new QScenePropertyChange(ComponentUpdated, this)); + propertyChange->setPropertyName(QByteArrayLiteral("shareable")); + propertyChange->setValue(d->m_shareable); + d->notifyObservers(propertyChange); + } + } +} + QComponent::QComponent(QComponentPrivate &dd, QNode *parent) : QNode(dd, parent) { |