summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2016-09-01 16:50:32 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2016-09-02 12:05:17 +0000
commit79aeeba87d3c17b4f652423a660a213f9e2faf25 (patch)
treecc52ef0159374fad58de7a3d4b14501514285a76
parent17b2060c1e899842be8c952afc8e0a3329178bc3 (diff)
Update QEntity docs
Change-Id: I4a28761474d961d39074490e12f21b3d0c7ac911 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--src/core/nodes/qentity.cpp44
-rw-r--r--src/quick3d/quick3d/items/quick3dentity.cpp27
2 files changed, 45 insertions, 26 deletions
diff --git a/src/core/nodes/qentity.cpp b/src/core/nodes/qentity.cpp
index 67238ca7e..ea3523c0c 100644
--- a/src/core/nodes/qentity.cpp
+++ b/src/core/nodes/qentity.cpp
@@ -55,15 +55,6 @@ QT_BEGIN_NAMESPACE
namespace Qt3DCore {
-QEntityPrivate::QEntityPrivate()
- : QNodePrivate()
- , m_parentEntityId()
-{}
-
-QEntityPrivate::~QEntityPrivate()
-{
-}
-
/*!
\class Qt3DCore::QEntity
\inmodule Qt3DCore
@@ -78,14 +69,25 @@ QEntityPrivate::~QEntityPrivate()
backend aspect will be able to interpret and process an Entity by
recognizing which components it is made up of. One aspect may decide to only
process entities composed of a single Qt3DCore::QTransform component whilst
- another may focus on Qt3DCore::QMouseHandler.
+ another may focus on Qt3DInput::QMouseHandler.
\sa Qt3DCore::QComponent, Qt3DCore::QTransform
-*/
+ */
+
+/*! \internal */
+QEntityPrivate::QEntityPrivate()
+ : QNodePrivate()
+ , m_parentEntityId()
+{}
+
+/*! \internal */
+QEntityPrivate::~QEntityPrivate()
+{
+}
/*!
Constructs a new Qt3DCore::QEntity instance with \a parent as parent.
-*/
+ */
QEntity::QEntity(QNode *parent)
: QEntity(*new QEntityPrivate, parent) {}
@@ -113,11 +115,11 @@ QEntity::~QEntity()
\relates Qt3DCore::QEntity
List of QComponent pointers.
-*/
+ */
/*!
Returns the list of Qt3DCore::QComponent instances the entity is referencing.
-*/
+ */
QComponentVector QEntity::components() const
{
Q_D(const QEntity);
@@ -129,7 +131,7 @@ QComponentVector QEntity::components() const
\note If the Qt3DCore::QComponent has no parent, the Qt3DCore::QEntity will set
itself as its parent thereby taking ownership of the component.
-*/
+ */
void QEntity::addComponent(QComponent *comp)
{
Q_D(QEntity);
@@ -161,7 +163,7 @@ void QEntity::addComponent(QComponent *comp)
/*!
Removes the reference to \a comp.
-*/
+ */
void QEntity::removeComponent(QComponent *comp)
{
Q_CHECK_PTR(comp);
@@ -186,7 +188,7 @@ void QEntity::removeComponent(QComponent *comp)
immediate parent isn't a Qt3DCore::QEntity, this function traverses up the
scene hierarchy until a parent Qt3DCore::QEntity is found. If no
Qt3DCore::QEntity parent can be found, returns null.
-*/
+ */
QEntity *QEntity::parentEntity() const
{
Q_D(const QEntity);
@@ -208,10 +210,10 @@ QEntity *QEntity::parentEntity() const
}
/*!
- Returns the Qt3DCore::QNodeId id of the parent Qt3DCore::QEntity instance of the
- current Qt3DCore::QEntity object. The QNodeId isNull method will return true if
- there is no Qt3DCore::QEntity parent of the current Qt3DCore::QEntity in the scene
- hierarchy.
+ Returns the Qt3DCore::QNodeId id of the parent Qt3DCore::QEntity instance of the
+ current Qt3DCore::QEntity object. The QNodeId isNull method will return true if
+ there is no Qt3DCore::QEntity parent of the current Qt3DCore::QEntity in the scene
+ hierarchy.
*/
QNodeId QEntityPrivate::parentEntityId() const
{
diff --git a/src/quick3d/quick3d/items/quick3dentity.cpp b/src/quick3d/quick3d/items/quick3dentity.cpp
index 4eac4400e..ebc92e843 100644
--- a/src/quick3d/quick3d/items/quick3dentity.cpp
+++ b/src/quick3d/quick3d/items/quick3dentity.cpp
@@ -47,20 +47,37 @@ namespace Quick {
/*!
\qmltype Entity
+ \instantiates Qt3DCore::QEntity
\inherits Node
\inqmlmodule Qt3D.Core
\since 5.5
-*/
+
+ \brief Entity is a \l Node subclass that can aggregate several
+ \l Component3D instances that will specify its behavior.
+
+ By itself a Entity is an empty shell. The behavior of a Entity
+ object is defined by the \l Component3D objects it references. Each Qt3D
+ backend aspect will be able to interpret and process an Entity by
+ recognizing which components it is made up of. One aspect may decide to only
+ process entities composed of a single \l Transform component whilst
+ another may focus on \l MouseHandler.
+
+ \sa Qt3D.Core::Component3D, Qt3D.Core::Transform
+ */
+
+/*!
+ \qmlproperty list<Component3D> Entity::components
+ Holds the list of \l Component3D instances, which define the behavior
+ of the entity.
+ \readonly
+ */
Quick3DEntity::Quick3DEntity(QObject *parent)
: QObject(parent)
{
}
-/*!
- \qmlproperty list<Component3D> Qt3DCore::Entity::components
- \readonly
-*/
+
QQmlListProperty<QComponent> Quick3DEntity::componentList()
{
return QQmlListProperty<Qt3DCore::QComponent>(this, 0,