diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2015-01-20 09:08:27 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2015-01-24 14:29:44 +0100 |
commit | cf407ce582af2700dc3a8fcdc7e1f74de9e62773 (patch) | |
tree | b6bd73138eb3969887646c49fe2d3d0affde10bc /src/render/frontend | |
parent | aa3a7c4051d0791c42fd20ffe25d51c7376dfa96 (diff) |
FrameGraphNode: add enabled property + setter/getter
Note: QFrameGraphNodePrivate already contained a m_enabled member which was
unused until now.
Change-Id: I10d81715c129877f73bafd2ae1c7314a3fa53e77
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend')
-rw-r--r-- | src/render/frontend/framegraph-components/qframegraphnode.cpp | 15 | ||||
-rw-r--r-- | src/render/frontend/framegraph-components/qframegraphnode.h | 7 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/render/frontend/framegraph-components/qframegraphnode.cpp b/src/render/frontend/framegraph-components/qframegraphnode.cpp index c94d9094d..8a2bdf8d1 100644 --- a/src/render/frontend/framegraph-components/qframegraphnode.cpp +++ b/src/render/frontend/framegraph-components/qframegraphnode.cpp @@ -103,6 +103,21 @@ QList<QFrameGraphNode *> QFrameGraphNode::frameGraphChildren() const return d->m_fgChildren; } +bool QFrameGraphNode::isEnabled() const +{ + Q_D(const QFrameGraphNode); + return d->m_enabled; +} + +void QFrameGraphNode::setEnabled(bool enabled) +{ + Q_D(QFrameGraphNode); + if (d->m_enabled != enabled) { + d->m_enabled = enabled; + emit enabledChanged(); + } +} + } // Qt3D diff --git a/src/render/frontend/framegraph-components/qframegraphnode.h b/src/render/frontend/framegraph-components/qframegraphnode.h index 19b1c4a93..bf4acc4cf 100644 --- a/src/render/frontend/framegraph-components/qframegraphnode.h +++ b/src/render/frontend/framegraph-components/qframegraphnode.h @@ -55,6 +55,7 @@ class QFrameGraphNodePrivate; class QT3DRENDERERSHARED_EXPORT QFrameGraphNode : public QNode { Q_OBJECT + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) public: explicit QFrameGraphNode(QNode *parent = 0); @@ -62,10 +63,16 @@ public: void removeFrameGraphNode(QFrameGraphNode *item); QList<QFrameGraphNode *> frameGraphChildren() 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(); + private: Q_DECLARE_PRIVATE(QFrameGraphNode) }; |