diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2014-09-29 17:19:36 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-10-03 21:18:41 +0200 |
commit | 7b26f6a1746419161a8f875e341b3e31220f4141 (patch) | |
tree | f784e568015e1f7f199abb388b97fefdb158c84e /src/render/frontend/qdepthmask.cpp | |
parent | c16689bb1ccf31416df7b8c69fe032898cf87dec (diff) |
QNode refactoring
Move almost everything to private classes.
Assimp loading restored.
All examples working.
QNode hierachy is now handled through QObject::setParent, addChild,
removeChild are part of the private api.
Note: commented QChangeArbiter unit tests as they can no longer work with this
patch and will restore them when QChangeArbiter will have been made private.
Task-number: QTBUG-41470
Task-number: QTBUG-41523
Change-Id: I4430974b3aa7f3744c38714b451b122e0cb4d0c9
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend/qdepthmask.cpp')
-rw-r--r-- | src/render/frontend/qdepthmask.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/render/frontend/qdepthmask.cpp b/src/render/frontend/qdepthmask.cpp index 923a10b9f..fcc86ee5c 100644 --- a/src/render/frontend/qdepthmask.cpp +++ b/src/render/frontend/qdepthmask.cpp @@ -41,6 +41,7 @@ ****************************************************************************/ #include "qdepthmask.h" +#include "qrenderstate_p.h" #include <private/qnode_p.h> #include <Qt3DCore/qscenepropertychange.h> @@ -48,15 +49,17 @@ QT_BEGIN_NAMESPACE namespace Qt3D { -class QDepthMaskPrivate : public QNodePrivate +class QDepthMaskPrivate : public QRenderStatePrivate { public: QDepthMaskPrivate(QDepthMask *qq) - : QNodePrivate(qq) + : QRenderStatePrivate(qq) , m_mask(false) { } + void copy(const QNodePrivate *ref) Q_DECL_OVERRIDE; + Q_DECLARE_PUBLIC(QDepthMask) bool m_mask; }; @@ -66,14 +69,11 @@ QDepthMask::QDepthMask(QNode *parent) { } -void QDepthMask::copy(const QNode *ref) +void QDepthMaskPrivate::copy(const QNodePrivate *ref) { - QRenderState::copy(ref); - Q_D(QDepthMask); - const QDepthMask *refState = qobject_cast<const QDepthMask *>(ref); - if (refState != Q_NULLPTR) { - d->m_mask = refState->mask(); - } + QRenderStatePrivate::copy(ref); + const QDepthMaskPrivate *refState = static_cast<const QDepthMaskPrivate *>(ref); + m_mask = refState->m_mask; } bool QDepthMask::mask() const @@ -92,16 +92,15 @@ void QDepthMask::setMask(bool mask) QScenePropertyChangePtr propertyChange(new QScenePropertyChange(NodeUpdated, this)); propertyChange->setPropertyName(QByteArrayLiteral("mask")); propertyChange->setValue(d->m_mask); - notifyObservers(propertyChange); + d->notifyObservers(propertyChange); } } } -QNode *QDepthMask::doClone(bool isClone) const +QNode *QDepthMask::doClone() const { QDepthMask *clone = new QDepthMask(); - clone->copy(this); - clone->d_func()->m_isClone = isClone; + clone->d_func()->copy(d_func()); return clone; } |