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/framegraph-components/qclearbuffer.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/framegraph-components/qclearbuffer.cpp')
-rw-r--r-- | src/render/frontend/framegraph-components/qclearbuffer.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/render/frontend/framegraph-components/qclearbuffer.cpp b/src/render/frontend/framegraph-components/qclearbuffer.cpp index 6e9ad4383..77370d53c 100644 --- a/src/render/frontend/framegraph-components/qclearbuffer.cpp +++ b/src/render/frontend/framegraph-components/qclearbuffer.cpp @@ -53,6 +53,13 @@ QClearBufferPrivate::QClearBufferPrivate(QClearBuffer *qq) { } +void QClearBufferPrivate::copy(const QNodePrivate *ref) +{ + QFrameGraphItemPrivate::copy(ref); + const QClearBufferPrivate *b = static_cast<const QClearBufferPrivate *>(ref); + m_buffersType = b->m_buffersType; +} + QClearBuffer::QClearBuffer(QNode *parent) : QFrameGraphItem(*new QClearBufferPrivate(this), parent) { @@ -63,14 +70,6 @@ QClearBuffer::QClearBuffer(QClearBufferPrivate &dd, QNode *parent) { } -void QClearBuffer::copy(const QNode *ref) -{ - Q_D(QClearBuffer); - QFrameGraphItem::copy(ref); - const QClearBuffer *b = qobject_cast<const QClearBuffer *>(ref); - if (b != Q_NULLPTR) - d->m_buffersType = b->buffers(); -} QClearBuffer::BufferType QClearBuffer::buffers() const { @@ -79,11 +78,15 @@ QClearBuffer::BufferType QClearBuffer::buffers() const } -QClearBuffer *QClearBuffer::doClone(bool isClone) const +QClearBuffer *QClearBuffer::doClone() const { + Q_D(const QClearBuffer); QClearBuffer *clone = new QClearBuffer(); - clone->copy(this); - clone->d_func()->m_isClone = isClone; + clone->d_func()->copy(d_func()); + + Q_FOREACH (QFrameGraphItem *fgChild, d->m_fgChildren) + clone->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone())); + return clone; } @@ -98,7 +101,7 @@ void QClearBuffer::setBuffers(QClearBuffer::BufferType buffers) QScenePropertyChangePtr propertyChange(new QScenePropertyChange(NodeUpdated, this)); propertyChange->setPropertyName(QByteArrayLiteral("buffers")); propertyChange->setValue(buffers); - notifyObservers(propertyChange); + d->notifyObservers(propertyChange); } } } |