summaryrefslogtreecommitdiffstats
path: root/src/render/frontend/qmaterial.cpp
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens.ecortex@kdab.com>2014-11-21 08:38:50 +0100
committerSean Harmer <sean.harmer@kdab.com>2014-11-27 15:03:46 +0100
commit01039e45417733e2d93f859f694eaba5ba7e4701 (patch)
treebd9099f57f9074b8bd73c3bcbcf934cd13bee3f8 /src/render/frontend/qmaterial.cpp
parenta0b300075f43432d3cbece6b2d25efa246923ba0 (diff)
Make cloning available to third party QNodes
Third party QNode subclasses won't have access to QNodePrivate, so move the clone() operation as a protected static method on QNode itself. This way third party nodes can implement deep copy in their copy() implementation as expected. Change-Id: I59d0414f4ea9c679f2b7e197ea90e36bd8a915a4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend/qmaterial.cpp')
-rw-r--r--src/render/frontend/qmaterial.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/render/frontend/qmaterial.cpp b/src/render/frontend/qmaterial.cpp
index 8998a1b1e..2ad4bc099 100644
--- a/src/render/frontend/qmaterial.cpp
+++ b/src/render/frontend/qmaterial.cpp
@@ -79,10 +79,10 @@ void QMaterial::copy(const QNode *ref)
QComponent::copy(ref);
const QMaterial *material = static_cast<const QMaterial*>(ref);
Q_FOREACH (QParameter *p, material->d_func()->m_parameters)
- addParameter(qobject_cast<QParameter *>(QNodePrivate::get(p)->clone()));
+ addParameter(qobject_cast<QParameter *>(QNode::clone(p)));
if (material->d_func()->m_effect)
- setEffect(qobject_cast<QEffect *>(QNodePrivate::get(material->d_func()->m_effect)->clone()));
+ setEffect(qobject_cast<QEffect *>(QNode::clone(material->d_func()->m_effect)));
}
QMaterial::QMaterial(QNode *parent)