summaryrefslogtreecommitdiffstats
path: root/src/render/frontend/framegraph-components
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/frontend/framegraph-components')
-rw-r--r--src/render/frontend/framegraph-components/qcameraselector.cpp27
-rw-r--r--src/render/frontend/framegraph-components/qcameraselector.h2
-rw-r--r--src/render/frontend/framegraph-components/qcameraselector_p.h1
-rw-r--r--src/render/frontend/framegraph-components/qclearbuffer.cpp16
-rw-r--r--src/render/frontend/framegraph-components/qclearbuffer.h2
-rw-r--r--src/render/frontend/framegraph-components/qframegraph.cpp18
-rw-r--r--src/render/frontend/framegraph-components/qframegraph.h2
-rw-r--r--src/render/frontend/framegraph-components/qframegraph_p.h1
-rw-r--r--src/render/frontend/framegraph-components/qlayerfilter.cpp15
-rw-r--r--src/render/frontend/framegraph-components/qlayerfilter.h2
-rw-r--r--src/render/frontend/framegraph-components/qrenderpassfilter.cpp25
-rw-r--r--src/render/frontend/framegraph-components/qrenderpassfilter.h2
-rw-r--r--src/render/frontend/framegraph-components/qrenderpassfilter_p.h1
-rw-r--r--src/render/frontend/framegraph-components/qrendertargetselector.cpp28
-rw-r--r--src/render/frontend/framegraph-components/qrendertargetselector.h2
-rw-r--r--src/render/frontend/framegraph-components/qrendertargetselector_p.h1
-rw-r--r--src/render/frontend/framegraph-components/qsortcriterion.cpp7
-rw-r--r--src/render/frontend/framegraph-components/qsortcriterion.h2
-rw-r--r--src/render/frontend/framegraph-components/qsortmethod.cpp21
-rw-r--r--src/render/frontend/framegraph-components/qsortmethod.h2
-rw-r--r--src/render/frontend/framegraph-components/qsortmethod_p.h1
-rw-r--r--src/render/frontend/framegraph-components/qtechniquefilter.cpp25
-rw-r--r--src/render/frontend/framegraph-components/qtechniquefilter.h2
-rw-r--r--src/render/frontend/framegraph-components/qtechniquefilter_p.h1
-rw-r--r--src/render/frontend/framegraph-components/qviewport.cpp15
-rw-r--r--src/render/frontend/framegraph-components/qviewport.h2
26 files changed, 81 insertions, 142 deletions
diff --git a/src/render/frontend/framegraph-components/qcameraselector.cpp b/src/render/frontend/framegraph-components/qcameraselector.cpp
index 959158774..4c84bb700 100644
--- a/src/render/frontend/framegraph-components/qcameraselector.cpp
+++ b/src/render/frontend/framegraph-components/qcameraselector.cpp
@@ -54,27 +54,22 @@ QCameraSelector::QCameraSelector(QCameraSelectorPrivate &dd, QNode *parent)
{
}
-QCameraSelector *QCameraSelector::doClone() const
-{
- Q_D(const QCameraSelector);
- QCameraSelector *cameraSelector = new QCameraSelector();
-
- cameraSelector->d_func()->copy(d_func());
-
- Q_FOREACH (QFrameGraphItem *fgChild, d->m_fgChildren)
- cameraSelector->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
-
- if (d->m_camera != Q_NULLPTR)
- cameraSelector->setCamera(qobject_cast<QEntity *>(QNodePrivate::get(d->m_camera)->clone()));
-
- return cameraSelector;
-}
-
QCameraSelectorPrivate::QCameraSelectorPrivate(Qt3D::QCameraSelector *qq)
: QFrameGraphItemPrivate(qq)
, m_camera(Q_NULLPTR)
{}
+void QCameraSelectorPrivate::copy(const QNodePrivate *ref)
+{
+ QFrameGraphItemPrivate::copy(ref);
+ const QCameraSelectorPrivate *other = static_cast<const QCameraSelectorPrivate*>(ref);
+ Q_FOREACH (QFrameGraphItem *fgChild, other->m_fgChildren)
+ q_func()->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
+
+ if (other->m_camera != Q_NULLPTR)
+ q_func()->setCamera(qobject_cast<QEntity *>(QNodePrivate::get(other->m_camera)->clone()));
+}
+
QCameraSelector::QCameraSelector(Qt3D::QNode *parent)
: QFrameGraphItem(*new QCameraSelectorPrivate(this), parent)
{}
diff --git a/src/render/frontend/framegraph-components/qcameraselector.h b/src/render/frontend/framegraph-components/qcameraselector.h
index cc20c0831..01723ed6c 100644
--- a/src/render/frontend/framegraph-components/qcameraselector.h
+++ b/src/render/frontend/framegraph-components/qcameraselector.h
@@ -69,7 +69,7 @@ Q_SIGNALS:
protected:
Q_DECLARE_PRIVATE(QCameraSelector)
QCameraSelector(QCameraSelectorPrivate &dd, QNode *parent = 0);
- QCameraSelector *doClone() const Q_DECL_OVERRIDE;
+ QT3D_CLONEABLE(QCameraSelector)
};
} // namespace Qt3D
diff --git a/src/render/frontend/framegraph-components/qcameraselector_p.h b/src/render/frontend/framegraph-components/qcameraselector_p.h
index 077fb131d..47f9ea6f0 100644
--- a/src/render/frontend/framegraph-components/qcameraselector_p.h
+++ b/src/render/frontend/framegraph-components/qcameraselector_p.h
@@ -55,6 +55,7 @@ class QCameraSelectorPrivate : public QFrameGraphItemPrivate
{
public:
QCameraSelectorPrivate(QCameraSelector *qq);
+ void copy(const QNodePrivate *ref) Q_DECL_OVERRIDE;
Q_DECLARE_PUBLIC(QCameraSelector)
QEntity *m_camera;
diff --git a/src/render/frontend/framegraph-components/qclearbuffer.cpp b/src/render/frontend/framegraph-components/qclearbuffer.cpp
index b1bd12eea..bbf006e1f 100644
--- a/src/render/frontend/framegraph-components/qclearbuffer.cpp
+++ b/src/render/frontend/framegraph-components/qclearbuffer.cpp
@@ -58,6 +58,9 @@ void QClearBufferPrivate::copy(const QNodePrivate *ref)
QFrameGraphItemPrivate::copy(ref);
const QClearBufferPrivate *b = static_cast<const QClearBufferPrivate *>(ref);
m_buffersType = b->m_buffersType;
+
+ Q_FOREACH (QFrameGraphItem *fgChild, b->m_fgChildren)
+ q_func()->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
}
QClearBuffer::QClearBuffer(QNode *parent)
@@ -77,19 +80,6 @@ QClearBuffer::BufferType QClearBuffer::buffers() const
return d->m_buffersType;
}
-
-QClearBuffer *QClearBuffer::doClone() const
-{
- Q_D(const QClearBuffer);
- QClearBuffer *clone = new QClearBuffer();
- clone->d_func()->copy(d_func());
-
- Q_FOREACH (QFrameGraphItem *fgChild, d->m_fgChildren)
- clone->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
-
- return clone;
-}
-
void QClearBuffer::setBuffers(QClearBuffer::BufferType buffers)
{
Q_D(QClearBuffer);
diff --git a/src/render/frontend/framegraph-components/qclearbuffer.h b/src/render/frontend/framegraph-components/qclearbuffer.h
index 8fdf9c926..15d60d492 100644
--- a/src/render/frontend/framegraph-components/qclearbuffer.h
+++ b/src/render/frontend/framegraph-components/qclearbuffer.h
@@ -80,7 +80,7 @@ protected:
private:
Q_DECLARE_PRIVATE(QClearBuffer)
- QClearBuffer *doClone() const Q_DECL_OVERRIDE;
+ QT3D_CLONEABLE(QClearBuffer)
};
} // Qt3D
diff --git a/src/render/frontend/framegraph-components/qframegraph.cpp b/src/render/frontend/framegraph-components/qframegraph.cpp
index 0e6f9ac9b..4cf9d1944 100644
--- a/src/render/frontend/framegraph-components/qframegraph.cpp
+++ b/src/render/frontend/framegraph-components/qframegraph.cpp
@@ -56,6 +56,13 @@ QFrameGraphPrivate::QFrameGraphPrivate(QFrameGraph *qq)
}
+void QFrameGraphPrivate::copy(const QNodePrivate *ref)
+{
+ QComponentPrivate::copy(ref);
+ const QFrameGraphPrivate *other = static_cast<const QFrameGraphPrivate *>(ref);
+ q_func()->setActiveFrameGraph(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(other->m_activeFrameGraph)->clone()));
+}
+
/*!
* \class FrameGraph
*
@@ -80,17 +87,6 @@ QFrameGraph::QFrameGraph(QFrameGraphPrivate &dd, QNode *parent)
{
}
-QFrameGraph *QFrameGraph::doClone() const
-{
- Q_D(const QFrameGraph);
- QFrameGraph *frameGraph = new QFrameGraph();
- frameGraph->d_func()->copy(d_func());
-
- frameGraph->setActiveFrameGraph(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(d->m_activeFrameGraph)->clone()));
-
- return frameGraph;
-}
-
/*!
* Returns the current activeFrameGraph root node.
*/
diff --git a/src/render/frontend/framegraph-components/qframegraph.h b/src/render/frontend/framegraph-components/qframegraph.h
index df7c3938e..798cd0ca1 100644
--- a/src/render/frontend/framegraph-components/qframegraph.h
+++ b/src/render/frontend/framegraph-components/qframegraph.h
@@ -74,7 +74,7 @@ protected:
private:
Q_DECLARE_PRIVATE(QFrameGraph)
- QFrameGraph *doClone() const Q_DECL_OVERRIDE;
+ QT3D_CLONEABLE(QFrameGraph)
};
} //Qt3D
diff --git a/src/render/frontend/framegraph-components/qframegraph_p.h b/src/render/frontend/framegraph-components/qframegraph_p.h
index aacf641a5..f7ce12ad8 100644
--- a/src/render/frontend/framegraph-components/qframegraph_p.h
+++ b/src/render/frontend/framegraph-components/qframegraph_p.h
@@ -56,6 +56,7 @@ class QFrameGraphPrivate : public QComponentPrivate
{
public:
QFrameGraphPrivate(QFrameGraph *qq);
+ void copy(const QNodePrivate *ref) Q_DECL_OVERRIDE;
Q_DECLARE_PUBLIC(QFrameGraph)
diff --git a/src/render/frontend/framegraph-components/qlayerfilter.cpp b/src/render/frontend/framegraph-components/qlayerfilter.cpp
index a01f676d9..088c85121 100644
--- a/src/render/frontend/framegraph-components/qlayerfilter.cpp
+++ b/src/render/frontend/framegraph-components/qlayerfilter.cpp
@@ -57,6 +57,8 @@ void QLayerFilterPrivate::copy(const QNodePrivate *ref)
QFrameGraphItemPrivate::copy(ref);
const QLayerFilterPrivate *layer = static_cast<const QLayerFilterPrivate *>(ref);
m_layers = layer->m_layers;
+ Q_FOREACH (QFrameGraphItem *fgChild, layer->m_fgChildren)
+ q_func()->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
}
QLayerFilter::QLayerFilter(QNode *parent)
@@ -69,19 +71,6 @@ QLayerFilter::QLayerFilter(QLayerFilterPrivate &dd, QNode *parent)
{
}
-QLayerFilter *QLayerFilter::doClone() const
-{
- Q_D(const QLayerFilter);
- QLayerFilter *filter = new QLayerFilter();
-
- filter->d_func()->copy(d_func());
-
- Q_FOREACH (QFrameGraphItem *fgChild, d->m_fgChildren)
- filter->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
-
- return filter;
-}
-
void QLayerFilter::setLayers(const QStringList &layers)
{
Q_D(QLayerFilter);
diff --git a/src/render/frontend/framegraph-components/qlayerfilter.h b/src/render/frontend/framegraph-components/qlayerfilter.h
index 983fc305a..304e96121 100644
--- a/src/render/frontend/framegraph-components/qlayerfilter.h
+++ b/src/render/frontend/framegraph-components/qlayerfilter.h
@@ -69,7 +69,7 @@ protected:
private:
Q_DECLARE_PRIVATE(QLayerFilter)
- QLayerFilter *doClone() const Q_DECL_OVERRIDE;
+ QT3D_CLONEABLE(QLayerFilter)
};
} // Qt3D
diff --git a/src/render/frontend/framegraph-components/qrenderpassfilter.cpp b/src/render/frontend/framegraph-components/qrenderpassfilter.cpp
index 37df2cf69..530e09783 100644
--- a/src/render/frontend/framegraph-components/qrenderpassfilter.cpp
+++ b/src/render/frontend/framegraph-components/qrenderpassfilter.cpp
@@ -59,21 +59,6 @@ QRenderPassFilter::QRenderPassFilter(QRenderPassFilterPrivate &dd, QNode *parent
{
}
-QRenderPassFilter *QRenderPassFilter::doClone() const
-{
- Q_D(const QRenderPassFilter);
- QRenderPassFilter *clone = new QRenderPassFilter();
-
- clone->d_func()->copy(d_func());
-
- Q_FOREACH (QFrameGraphItem *fgChild, d->m_fgChildren)
- clone->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
- Q_FOREACH (QCriterion *c, d->m_criteriaList)
- clone->addCriterion(qobject_cast<QCriterion *>(QNodePrivate::get(c)->clone()));
-
- return clone;
-}
-
QList<QCriterion *> QRenderPassFilter::criteria() const
{
Q_D(const QRenderPassFilter);
@@ -114,6 +99,16 @@ void QRenderPassFilter::removeCriterion(QCriterion *criterion)
d->m_criteriaList.removeOne(criterion);
}
+void QRenderPassFilterPrivate::copy(const QNodePrivate *ref)
+{
+ QFrameGraphItemPrivate::copy(ref);
+ const QRenderPassFilterPrivate *other = static_cast<const QRenderPassFilterPrivate*>(ref);
+ Q_FOREACH (QFrameGraphItem *fgChild, other->m_fgChildren)
+ q_func()->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
+ Q_FOREACH (QCriterion *c, other->m_criteriaList)
+ q_func()->addCriterion(qobject_cast<QCriterion *>(QNodePrivate::get(c)->clone()));
+}
+
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/render/frontend/framegraph-components/qrenderpassfilter.h b/src/render/frontend/framegraph-components/qrenderpassfilter.h
index e7e663368..d2a4202ce 100644
--- a/src/render/frontend/framegraph-components/qrenderpassfilter.h
+++ b/src/render/frontend/framegraph-components/qrenderpassfilter.h
@@ -70,7 +70,7 @@ protected:
private:
Q_DECLARE_PRIVATE(QRenderPassFilter)
- QRenderPassFilter *doClone() const Q_DECL_OVERRIDE;
+ QT3D_CLONEABLE(QRenderPassFilter)
};
} // namespace Qt3D
diff --git a/src/render/frontend/framegraph-components/qrenderpassfilter_p.h b/src/render/frontend/framegraph-components/qrenderpassfilter_p.h
index 3da27e1e2..1b7207e34 100644
--- a/src/render/frontend/framegraph-components/qrenderpassfilter_p.h
+++ b/src/render/frontend/framegraph-components/qrenderpassfilter_p.h
@@ -56,6 +56,7 @@ public:
QRenderPassFilterPrivate(QRenderPassFilter *qq)
: QFrameGraphItemPrivate(qq)
{}
+ void copy(const QNodePrivate *ref) Q_DECL_OVERRIDE;
Q_DECLARE_PUBLIC(QRenderPassFilter)
QString m_renderPassName;
diff --git a/src/render/frontend/framegraph-components/qrendertargetselector.cpp b/src/render/frontend/framegraph-components/qrendertargetselector.cpp
index 81804903a..54f43ee90 100644
--- a/src/render/frontend/framegraph-components/qrendertargetselector.cpp
+++ b/src/render/frontend/framegraph-components/qrendertargetselector.cpp
@@ -55,6 +55,18 @@ QRenderTargetSelectorPrivate::QRenderTargetSelectorPrivate(QRenderTargetSelector
{
}
+void QRenderTargetSelectorPrivate::copy(const QNodePrivate *ref)
+{
+ QFrameGraphItemPrivate::copy(ref);
+
+ const QRenderTargetSelectorPrivate *other = static_cast<const QRenderTargetSelectorPrivate*>(ref);
+ Q_FOREACH (QFrameGraphItem *fgChild, other->m_fgChildren)
+ q_func()->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
+
+ if (other->m_target != Q_NULLPTR)
+ q_func()->setTarget(qobject_cast<QRenderTarget *>(QNodePrivate::get(other->m_target)->clone()));
+}
+
QRenderTargetSelector::QRenderTargetSelector(QNode *parent)
: QFrameGraphItem(*new QRenderTargetSelectorPrivate(this), parent)
{
@@ -84,22 +96,6 @@ QRenderTargetSelector::QRenderTargetSelector(QRenderTargetSelectorPrivate &dd, Q
{
}
-QRenderTargetSelector *QRenderTargetSelector::doClone() const
-{
- Q_D(const QRenderTargetSelector);
- QRenderTargetSelector *clone = new QRenderTargetSelector();
-
- clone->d_func()->copy(d_func());
-
- Q_FOREACH (QFrameGraphItem *fgChild, d->m_fgChildren)
- clone->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
-
- if (d->m_target != Q_NULLPTR)
- clone->setTarget(qobject_cast<QRenderTarget *>(QNodePrivate::get(d->m_target)->clone()));
-
- return clone;
-}
-
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/render/frontend/framegraph-components/qrendertargetselector.h b/src/render/frontend/framegraph-components/qrendertargetselector.h
index 5205e19e6..504a0711f 100644
--- a/src/render/frontend/framegraph-components/qrendertargetselector.h
+++ b/src/render/frontend/framegraph-components/qrendertargetselector.h
@@ -71,7 +71,7 @@ protected:
private:
Q_DECLARE_PRIVATE(QRenderTargetSelector)
- QRenderTargetSelector *doClone() const Q_DECL_OVERRIDE;
+ QT3D_CLONEABLE(QRenderTargetSelector)
};
} // Qt3D
diff --git a/src/render/frontend/framegraph-components/qrendertargetselector_p.h b/src/render/frontend/framegraph-components/qrendertargetselector_p.h
index 285004952..0d4e2acb7 100644
--- a/src/render/frontend/framegraph-components/qrendertargetselector_p.h
+++ b/src/render/frontend/framegraph-components/qrendertargetselector_p.h
@@ -55,6 +55,7 @@ class QRenderTargetSelectorPrivate : public QFrameGraphItemPrivate
{
public:
QRenderTargetSelectorPrivate(QRenderTargetSelector *qq);
+ void copy(const QNodePrivate *ref) Q_DECL_OVERRIDE;
Q_DECLARE_PUBLIC(QRenderTargetSelector)
QRenderTarget *m_target;
diff --git a/src/render/frontend/framegraph-components/qsortcriterion.cpp b/src/render/frontend/framegraph-components/qsortcriterion.cpp
index f91cc655f..a2e7de7de 100644
--- a/src/render/frontend/framegraph-components/qsortcriterion.cpp
+++ b/src/render/frontend/framegraph-components/qsortcriterion.cpp
@@ -86,13 +86,6 @@ QSortCriterion::QSortCriterion(QSortCriterionPrivate &dd, QNode *parent)
{
}
-QSortCriterion *QSortCriterion::doClone() const
-{
- QSortCriterion *clone = new QSortCriterion();
- clone->d_func()->copy(d_func());
- return clone;
-}
-
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/render/frontend/framegraph-components/qsortcriterion.h b/src/render/frontend/framegraph-components/qsortcriterion.h
index 130980c89..2bd5914bc 100644
--- a/src/render/frontend/framegraph-components/qsortcriterion.h
+++ b/src/render/frontend/framegraph-components/qsortcriterion.h
@@ -75,7 +75,7 @@ protected:
QSortCriterion(QSortCriterionPrivate &dd, QNode *parent = 0);
private:
- QSortCriterion *doClone() const Q_DECL_OVERRIDE;
+ QT3D_CLONEABLE(QSortCriterion)
Q_DECLARE_PRIVATE(QSortCriterion)
};
diff --git a/src/render/frontend/framegraph-components/qsortmethod.cpp b/src/render/frontend/framegraph-components/qsortmethod.cpp
index f71b09f68..741e0aced 100644
--- a/src/render/frontend/framegraph-components/qsortmethod.cpp
+++ b/src/render/frontend/framegraph-components/qsortmethod.cpp
@@ -54,6 +54,14 @@ QSortMethodPrivate::QSortMethodPrivate(QSortMethod *qq)
{
}
+void QSortMethodPrivate::copy(const QNodePrivate *ref)
+{
+ QFrameGraphItemPrivate::copy(ref);
+ const QSortMethodPrivate *other = static_cast<const QSortMethodPrivate*>(ref);
+ Q_FOREACH (QSortCriterion *c, other->m_criteria)
+ q_func()->addCriterion(qobject_cast<QSortCriterion *>(QNodePrivate::get(c)->clone()));
+}
+
QSortMethod::QSortMethod(QNode *parent)
: QFrameGraphItem(*new QSortMethodPrivate(this), parent)
{
@@ -64,19 +72,6 @@ QSortMethod::QSortMethod(QSortMethodPrivate &dd, QNode *parent)
{
}
-QSortMethod *QSortMethod::doClone() const
-{
- Q_D(const QSortMethod);
- QSortMethod *clone = new QSortMethod();
-
- clone->d_func()->copy(d_func());
-
- Q_FOREACH (QSortCriterion *c, d->m_criteria)
- clone->addCriterion(qobject_cast<QSortCriterion *>(QNodePrivate::get(c)->clone()));
-
- return clone;
-}
-
void QSortMethod::addCriterion(QSortCriterion *criterion)
{
Q_D(QSortMethod);
diff --git a/src/render/frontend/framegraph-components/qsortmethod.h b/src/render/frontend/framegraph-components/qsortmethod.h
index b971e5572..fd53f4b7a 100644
--- a/src/render/frontend/framegraph-components/qsortmethod.h
+++ b/src/render/frontend/framegraph-components/qsortmethod.h
@@ -67,7 +67,7 @@ protected:
private:
Q_DECLARE_PRIVATE(QSortMethod)
- QSortMethod *doClone() const Q_DECL_OVERRIDE;
+ QT3D_CLONEABLE(QSortMethod)
};
} // Qt3D
diff --git a/src/render/frontend/framegraph-components/qsortmethod_p.h b/src/render/frontend/framegraph-components/qsortmethod_p.h
index 6ef90b90f..551cb897d 100644
--- a/src/render/frontend/framegraph-components/qsortmethod_p.h
+++ b/src/render/frontend/framegraph-components/qsortmethod_p.h
@@ -55,6 +55,7 @@ class QSortMethodPrivate : public QFrameGraphItemPrivate
{
public:
QSortMethodPrivate(QSortMethod *qq);
+ void copy(const QNodePrivate *ref) Q_DECL_OVERRIDE;
Q_DECLARE_PUBLIC(QSortMethod)
QList<QSortCriterion *> m_criteria;
};
diff --git a/src/render/frontend/framegraph-components/qtechniquefilter.cpp b/src/render/frontend/framegraph-components/qtechniquefilter.cpp
index b65d8a879..71404b94c 100644
--- a/src/render/frontend/framegraph-components/qtechniquefilter.cpp
+++ b/src/render/frontend/framegraph-components/qtechniquefilter.cpp
@@ -55,6 +55,16 @@ QTechniqueFilterPrivate::QTechniqueFilterPrivate(QTechniqueFilter *qq)
{
}
+void QTechniqueFilterPrivate::copy(const QNodePrivate *ref)
+{
+ QFrameGraphItemPrivate::copy(ref);
+ const QTechniqueFilterPrivate *other = static_cast<const QTechniqueFilterPrivate*>(ref);
+ Q_FOREACH (QFrameGraphItem *fgChild, other->m_fgChildren)
+ q_func()->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
+ Q_FOREACH (QCriterion *crit, other->m_criteriaList)
+ q_func()->addCriterion(qobject_cast<QCriterion *>(QNodePrivate::get(crit)->clone()));
+}
+
QTechniqueFilter::QTechniqueFilter(QNode *parent)
: QFrameGraphItem(*new QTechniqueFilterPrivate(this), parent)
{
@@ -65,21 +75,6 @@ QTechniqueFilter::QTechniqueFilter(QTechniqueFilterPrivate &dd, QNode *parent)
{
}
-QTechniqueFilter *QTechniqueFilter::doClone() const
-{
- Q_D(const QTechniqueFilter);
- QTechniqueFilter *clone = new QTechniqueFilter();
-
- clone->d_func()->copy(d_func());
-
- Q_FOREACH (QFrameGraphItem *fgChild, d->m_fgChildren)
- clone->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
- Q_FOREACH (QCriterion *crit, d->m_criteriaList)
- clone->addCriterion(qobject_cast<QCriterion *>(QNodePrivate::get(crit)->clone()));
-
- return clone;
-}
-
QList<QCriterion *> QTechniqueFilter::criteria() const
{
Q_D(const QTechniqueFilter);
diff --git a/src/render/frontend/framegraph-components/qtechniquefilter.h b/src/render/frontend/framegraph-components/qtechniquefilter.h
index 37e7e96ed..00994b466 100644
--- a/src/render/frontend/framegraph-components/qtechniquefilter.h
+++ b/src/render/frontend/framegraph-components/qtechniquefilter.h
@@ -67,7 +67,7 @@ protected:
private:
Q_DECLARE_PRIVATE(QTechniqueFilter)
- QTechniqueFilter *doClone() const Q_DECL_OVERRIDE;
+ QT3D_CLONEABLE(QTechniqueFilter)
};
} // namespace Qt3D
diff --git a/src/render/frontend/framegraph-components/qtechniquefilter_p.h b/src/render/frontend/framegraph-components/qtechniquefilter_p.h
index edcc3c454..c642b38ed 100644
--- a/src/render/frontend/framegraph-components/qtechniquefilter_p.h
+++ b/src/render/frontend/framegraph-components/qtechniquefilter_p.h
@@ -54,6 +54,7 @@ class QTechniqueFilterPrivate : public QFrameGraphItemPrivate
{
public :
QTechniqueFilterPrivate(QTechniqueFilter *qq);
+ void copy(const QNodePrivate *ref) Q_DECL_OVERRIDE;
Q_DECLARE_PUBLIC(QTechniqueFilter)
QList<QCriterion *> m_criteriaList;
diff --git a/src/render/frontend/framegraph-components/qviewport.cpp b/src/render/frontend/framegraph-components/qviewport.cpp
index d86094065..9894ff08e 100644
--- a/src/render/frontend/framegraph-components/qviewport.cpp
+++ b/src/render/frontend/framegraph-components/qviewport.cpp
@@ -58,6 +58,8 @@ void QViewportPrivate::copy(const QNodePrivate *ref)
QFrameGraphItemPrivate::copy(ref);
const QViewportPrivate *viewport = static_cast<const QViewportPrivate *>(ref);
m_rect = viewport->m_rect;
+ Q_FOREACH (QFrameGraphItem *fgChild, viewport->m_fgChildren)
+ q_func()->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
}
QViewport::QViewport(QNode *parent)
@@ -70,19 +72,6 @@ QViewport::QViewport(QViewportPrivate &dd, QNode *parent)
{
}
-QViewport *QViewport::doClone() const
-{
- Q_D(const QViewport);
- QViewport *clone = new QViewport();
-
- clone->d_func()->copy(d_func());
-
- Q_FOREACH (QFrameGraphItem *fgChild, d->m_fgChildren)
- clone->appendFrameGraphItem(qobject_cast<QFrameGraphItem *>(QNodePrivate::get(fgChild)->clone()));
-
- return clone;
-}
-
QRectF QViewport::rect() const
{
Q_D(const QViewport);
diff --git a/src/render/frontend/framegraph-components/qviewport.h b/src/render/frontend/framegraph-components/qviewport.h
index 4b8499eea..ce2410e84 100644
--- a/src/render/frontend/framegraph-components/qviewport.h
+++ b/src/render/frontend/framegraph-components/qviewport.h
@@ -76,7 +76,7 @@ protected:
private:
Q_DECLARE_PRIVATE(QViewport)
- QViewport *doClone() const Q_DECL_OVERRIDE;
+ QT3D_CLONEABLE(QViewport)
};
} // Qt3D