summaryrefslogtreecommitdiffstats
path: root/src/render/frontend
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-03-31 11:26:36 +0200
committerPaul Lemire <paul.lemire@kdab.com>2015-05-10 12:25:31 +0000
commit90ba9328495574f8fbd745fb9825bf02e8c2f28d (patch)
treee09d595f381781a85674f9494af71eba70f42623 /src/render/frontend
parentb43e70b9dde614a91d6c9f993c3b444cd113e4e2 (diff)
FrameGraph: allow the FrameGraph tree to contain any kind of Nodes
Change-Id: Ib5a6ea27610dfad3352adacd57c8f0f02c97f31f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend')
-rw-r--r--src/render/frontend/framegraph-components/qframegraphnode.cpp42
-rw-r--r--src/render/frontend/framegraph-components/qframegraphnode.h5
2 files changed, 12 insertions, 35 deletions
diff --git a/src/render/frontend/framegraph-components/qframegraphnode.cpp b/src/render/frontend/framegraph-components/qframegraphnode.cpp
index d3cf5f835..fadf049b8 100644
--- a/src/render/frontend/framegraph-components/qframegraphnode.cpp
+++ b/src/render/frontend/framegraph-components/qframegraphnode.cpp
@@ -62,48 +62,28 @@ QFrameGraphNodePrivate::QFrameGraphNodePrivate(QFrameGraphNode *qq)
{
}
-void QFrameGraphNode::copy(const QNode *ref)
-{
- QNode::copy(ref);
- const QFrameGraphNode *refNode = static_cast<const QFrameGraphNode *>(ref);
- Q_FOREACH (QFrameGraphNode *fgChild, refNode->d_func()->m_fgChildren)
- appendFrameGraphNode(qobject_cast<QFrameGraphNode *>(QNode::clone(fgChild)));
-
-}
-
QFrameGraphNode::QFrameGraphNode(QNode *parent)
: QNode(*new QFrameGraphNodePrivate(this), parent)
{
}
-/*! \internal */
-QFrameGraphNode::QFrameGraphNode(QFrameGraphNodePrivate &dd, QNode *parent)
- : QNode(dd, parent)
+QFrameGraphNode *QFrameGraphNode::parentFrameGraphNode() const
{
-}
+ QFrameGraphNode *parentFGNode = Q_NULLPTR;
+ QNode *parentN = parentNode();
-void QFrameGraphNode::appendFrameGraphNode(QFrameGraphNode *item)
-{
- Q_D(QFrameGraphNode);
- if (!d->m_fgChildren.contains(item)) {
- if (!item->parent())
- item->setParent(this);
- d->m_fgChildren.append(item);
+ while (parentN) {
+ if ((parentFGNode = qobject_cast<QFrameGraphNode *>(parentN)) != Q_NULLPTR)
+ break;
+ parentN = parentN->parentNode();
}
+ return parentFGNode;
}
-void QFrameGraphNode::removeFrameGraphNode(QFrameGraphNode *item)
-{
- Q_D(QFrameGraphNode);
- if (!d->m_fgChildren.contains(item)) {
- d->m_fgChildren.removeOne(item);
- }
-}
-
-QList<QFrameGraphNode *> QFrameGraphNode::frameGraphChildren() const
+/*! \internal */
+QFrameGraphNode::QFrameGraphNode(QFrameGraphNodePrivate &dd, QNode *parent)
+ : QNode(dd, parent)
{
- Q_D(const QFrameGraphNode);
- return d->m_fgChildren;
}
/*!
diff --git a/src/render/frontend/framegraph-components/qframegraphnode.h b/src/render/frontend/framegraph-components/qframegraphnode.h
index b6f8bf1f4..7fb5e4dfa 100644
--- a/src/render/frontend/framegraph-components/qframegraphnode.h
+++ b/src/render/frontend/framegraph-components/qframegraphnode.h
@@ -54,16 +54,13 @@ class QT3DRENDERERSHARED_EXPORT QFrameGraphNode : public QNode
public:
explicit QFrameGraphNode(QNode *parent = 0);
- void appendFrameGraphNode(QFrameGraphNode *item);
- void removeFrameGraphNode(QFrameGraphNode *item);
- QList<QFrameGraphNode *> frameGraphChildren() const;
+ QFrameGraphNode *parentFrameGraphNode() const;
bool isEnabled() const;
void setEnabled(bool enabled);
protected:
QFrameGraphNode(QFrameGraphNodePrivate &dd, QNode *parent = 0);
- void copy(const QNode *ref) Q_DECL_OVERRIDE;
Q_SIGNALS:
void enabledChanged();