QComponent Class

( Qt3DCore::QComponent )

The base class of scene nodes that can be aggregated by Qt3DCore::QEntity instances as a component. 更多...

头: #include <QComponent>
qmake: QT += 3dcore
Since: Qt 5.5
实例化: Component3D
继承: Qt3DCore::QNode
继承者: Qt3DAnimation::QAbstractClipAnimator , Qt3DCore::QTransform , Qt3DInput::QAxisAccumulator , Qt3DInput::QInputSettings , Qt3DInput::QKeyboardHandler , Qt3DInput::QLogicalDevice , Qt3DInput::QMouseHandler , Qt3DLogic::QFrameAction , Qt3DRender::QAbstractLight , Qt3DRender::QCameraLens , Qt3DRender::QComputeCommand , Qt3DRender::QEnvironmentLight , Qt3DRender::QGeometryRenderer , Qt3DRender::QLayer , Qt3DRender::QLevelOfDetail , Qt3DRender::QMaterial , Qt3DRender::QObjectPicker , Qt3DRender::QRenderSettings , Qt3DRender::QRenderTarget , Qt3DRender::QSceneLoader ,和 Qt3DRender::QShaderData

特性

公共函数

QComponent (QNode * parent = nullptr)
~QComponent ()
QVector<QEntity *> entities () const
bool isShareable () const

公共槽

void setShareable (bool isShareable )

信号

void addedToEntity (QEntity * entity )
void removedFromEntity (QEntity * entity )
void shareableChanged (bool isShareable )

额外继承成员

详细描述

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

A Qt3DCore::QComponent provides a vertical slice of behavior that can be assigned to and sometimes shared across Qt3DCore::QEntity 实例。

Qt3DCore::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 Qt3DCore::QTransform , Qt3DRender::QMesh ,和 Qt3DRender::QMaterial components.

另请参阅 Qt3DCore::QEntity .

特性文档编制

isShareable : bool

Holds the shareable flag of the QComponent QComponent can be shared across several entities if true .

访问函数:

bool isShareable () const
void setShareable (bool isShareable )

通知程序信号:

void shareableChanged (bool isShareable )

成员函数文档编制

QComponent:: QComponent ( QNode * parent = nullptr)

构造新的 QComponent 实例与 parent as the parent.

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

QComponent:: ~QComponent ()

Destroys the instance of QComponent.

[signal] void QComponent:: addedToEntity ( QEntity * entity )

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

返回 QVector containing all the entities that reference this component.

[signal] void QComponent:: removedFromEntity ( QEntity * entity )