QComponent Class

(Qt3D::QComponent)

The base class of scene nodes that can be aggregated by Qt3D::QEntity instances as a component. More...

Header: #include <QComponent>
qmake: QT += 3dcore
Since: Qt 5.5
Instantiated By: Component3D
Inherits: QNode
Inherited By:

Qt3D::QCameraLens, Qt3D::QKeyboardInput, and Qt3D::QMouseInput

Properties

Public Functions

QComponent(QNode * parent = 0)
~QComponent()
QVector<QEntity *> entities() const
bool isEnabled() const
void setEnabled(bool enabled)
void setShareable(bool shareable)
bool shareable() const
  • 6 public functions inherited from Qt3D::QNode
  • 31 public functions inherited from QObject

Signals

Reimplemented Protected Functions

virtual void copy(const QNode * ref)
  • 3 protected functions inherited from Qt3D::QNode
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject
  • 3 protected functions inherited from Qt3D::QNode
  • 9 protected functions inherited from QObject
  • 1 static protected member inherited from Qt3D::QNode

Detailed Description

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.

See also Qt3D::QEntity.

Property Documentation

enabled : bool

Access functions:

bool isEnabled() const
void setEnabled(bool enabled)

Notifier signal:

void enabledChanged()

shareable : bool

Access functions:

bool shareable() const
void setShareable(bool shareable)

Notifier signal:

void shareableChanged()

Member Function Documentation

QComponent::QComponent(QNode * parent = 0)

Constructs a new QComponent instance with parent as the parent.

Note: a QComponent should never be instanced directly, instance one of the subclasses instead.

QComponent::~QComponent()

[virtual protected] void QComponent::copy(const QNode * ref)

QVector<QEntity *> QComponent::entities() const

Returns a QVector containing all the entities that reference this component.

bool QComponent::isEnabled() const

Returns whether the QComponent is enabled or not.

Note: Getter function for property enabled.

void QComponent::setEnabled(bool enabled)

Set the QComponent to enabled if enabled is true. By default a Qt3D::QComponent is always enabled.

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.

Note: Setter function for property enabled.

See also isEnabled().

void QComponent::setShareable(bool shareable)

The QComponent can be shared across several entities if shareable is true.

Note: Setter function for property shareable.

See also shareable().

bool QComponent::shareable() const

Returns whether the QComponent is shareable across entities or not.

Note: Getter function for property shareable.

See also setShareable().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.