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/qlayer.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/qlayer.cpp')
-rw-r--r-- | src/render/frontend/qlayer.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/render/frontend/qlayer.cpp b/src/render/frontend/qlayer.cpp index 215fd4689..79dbfca97 100644 --- a/src/render/frontend/qlayer.cpp +++ b/src/render/frontend/qlayer.cpp @@ -51,31 +51,28 @@ QLayerPrivate::QLayerPrivate(QLayer *qq) { } -QLayer::QLayer(QNode *parent) - : QComponent(*new QLayerPrivate(this), parent) +void QLayerPrivate::copy(const QNodePrivate *ref) { + QComponentPrivate::copy(ref); + const QLayerPrivate *layer = static_cast<const QLayerPrivate *>(ref); + m_name = layer->m_name; } -void QLayer::copy(const QNode *ref) +QLayer::QLayer(QNode *parent) + : QComponent(*new QLayerPrivate(this), parent) { - Q_D(QLayer); - QComponent::copy(ref); - const QLayer *layer = qobject_cast<const QLayer *>(ref); - if (layer != Q_NULLPTR) { - d->m_name = layer->name(); - } } + QLayer::QLayer(QLayerPrivate &dd, QNode *parent) : QComponent(dd, parent) { } -QLayer *QLayer::doClone(bool isClone) const +QLayer *QLayer::doClone() const { QLayer *clone = new QLayer(); - clone->copy(this); - clone->d_func()->m_isClone = isClone; + clone->d_func()->copy(d_func()); return clone; } |