summaryrefslogtreecommitdiffstats
path: root/src/core/nodes/qcomponent.cpp
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2015-06-05 15:48:38 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-06-05 15:48:38 +0100
commit8f58119cd18d69fac28528f0a7536cb9fccc15e3 (patch)
tree844835179ebeca6724c62e47c2cd22650025ef1f /src/core/nodes/qcomponent.cpp
parent2e778e83cb12c830dbbf4887d107e1788a0ce605 (diff)
parentca2ae5592d4a2eb01f0254c712159657c79c9449 (diff)
Merge branch '5.5' into dev
Diffstat (limited to 'src/core/nodes/qcomponent.cpp')
-rw-r--r--src/core/nodes/qcomponent.cpp61
1 files changed, 51 insertions, 10 deletions
diff --git a/src/core/nodes/qcomponent.cpp b/src/core/nodes/qcomponent.cpp
index 815775e5b..d9a99d50d 100644
--- a/src/core/nodes/qcomponent.cpp
+++ b/src/core/nodes/qcomponent.cpp
@@ -45,8 +45,12 @@ QT_BEGIN_NAMESPACE
namespace Qt3D {
-QComponentPrivate::QComponentPrivate(QComponent *qq)
- : QNodePrivate(qq)
+/*!
+ \class Qt3D::QComponentPrivate
+ \internal
+*/
+QComponentPrivate::QComponentPrivate()
+ : QNodePrivate()
, m_shareable(true)
, m_enabled(true)
{
@@ -81,12 +85,32 @@ void QComponentPrivate::removeEntity(QEntity *entity)
}
/*!
+ \class Qt3D::QComponent
+ \inmodule Qt3DCore
+ \inherits Qt3D::QNode
+ \since 5.5
+
+ \brief The base class of scene nodes that can be aggregated by Qt3D::QEntity
+ instances as a component.
+
+ A Qt3D::QComponent provides a vertical slice of behavior that can be assigned to and
+ sometimes shared across Qt3D::QEntity instances.
+
+ Qt3D::QComponent subclasses are often aggregated in groups that impart useful
+ behavior to the aggregating entity. For example, to have an Entity that gets
+ drawn by the Qt3D renderer aspect, an entity would most likely aggregate
+ Qt3D::QTransform, Qt3D::QMesh, and Qt3D::QMaterial components.
+
+ \sa Qt3D::QEntity
+*/
+
+/*!
Constructs a new QComponent instance with \a parent as the parent.
\note a QComponent should never be instanced directly,
instance one of the subclasses instead.
- */
+*/
QComponent::QComponent(QNode *parent)
- : QNode(*new QComponentPrivate(this), parent)
+ : QNode(*new QComponentPrivate, parent)
{
}
@@ -101,7 +125,7 @@ QComponent::~QComponent()
/*!
Returns whether the QComponent is shareable across entities or not.
- */
+*/
bool QComponent::shareable() const
{
Q_D(const QComponent);
@@ -110,7 +134,7 @@ bool QComponent::shareable() const
/*!
Returns whether the QComponent is enabled or not.
- */
+*/
bool QComponent::isEnabled() const
{
Q_D(const QComponent);
@@ -124,7 +148,7 @@ bool QComponent::isEnabled() const
\note the interpretation of what enabled means is aspect-dependent. Even if
enabled is set to false, some aspects may still consider the component in
some manner. This is documented on a class by class basis.
- */
+*/
void QComponent::setEnabled(bool enabled)
{
Q_D(QComponent);
@@ -136,7 +160,7 @@ void QComponent::setEnabled(bool enabled)
/*!
The QComponent can be shared across several entities if \a shareable is true.
- */
+*/
void QComponent::setShareable(bool shareable)
{
Q_D(QComponent);
@@ -155,14 +179,15 @@ void QComponent::copy(const QNode *ref)
}
/*!
- * Returns a QVector containing all the entities that reference this component.
- */
+ Returns a QVector containing all the entities that reference this component.
+*/
QVector<QEntity *> QComponent::entities() const
{
Q_D(const QComponent);
return d->m_entities;
}
+/*! \internal */
QComponent::QComponent(QComponentPrivate &dd, QNode *parent)
: QNode(dd, parent)
{
@@ -170,4 +195,20 @@ QComponent::QComponent(QComponentPrivate &dd, QNode *parent)
} // namespace Qt3D
+/*!
+ \qmltype Component3D
+ \instantiates Qt3D::QComponent
+ \inqmlmodule Qt3D
+ \inherits Node
+ \since 5.5
+*/
+
+/*!
+ \qmlproperty bool Qt3D::Component3D::shareable
+*/
+
+/*!
+ \qmlproperty bool Qt3D::Component3D::enabled
+*/
+
QT_END_NAMESPACE