QEntity Class

class Qt3DCore::QEntity

Qt3DCore::QEntity 는 동작을 지정하는 여러 Qt3DCore::QComponent 인스턴스를 집계할 수 있는 Qt3DCore::QNode 서브클래스입니다. 더 보기...

헤더: #include <QEntity>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3DCore)
target_link_libraries(mytarget PRIVATE Qt6::3DCore)
qmake: QT += 3dcore
QML에서: Entity
상속합니다: Qt3DCore::QNode
상속합니다:

Qt3DExtras::QAbstractCameraController, Qt3DExtras::QSkyboxEntity, Qt3DExtras::QText2DEntity, 그리고 Qt3DRender::QCamera

Status: Deprecated

공용 함수

QEntity(Qt3DCore::QNode *parent = nullptr)
void addComponent(Qt3DCore::QComponent *comp)
Qt3DCore::QComponentVector components() const
QList<T *> componentsOfType() const
Qt3DCore::QEntity *parentEntity() const
void removeComponent(Qt3DCore::QComponent *comp)

상세 설명

Qt3DCore::QEntity 자체는 빈 셸입니다. Qt3DCore::QEntity 객체의 동작은 참조하는 Qt3DCore::QComponent 객체에 의해 정의됩니다. 각 Qt3D 백엔드 측면은 엔티티가 어떤 컴포넌트로 구성되어 있는지 인식하여 엔티티를 해석하고 처리할 수 있습니다. 한 측면은 단일 Qt3DCore::QTransform 컴포넌트로 구성된 엔티티만 처리하는 반면 다른 측면은 Qt3DInput::QMouseHandler 에 초점을 맞출 수 있습니다.

Qt3DCore::QComponentQt3DCore::QTransform참조하세요 .

멤버 함수 문서

[explicit] QEntity::QEntity(Qt3DCore::QNode *parent = nullptr)

parent 을 부모로 하여 새 Qt3DCore::QEntity 인스턴스를 생성합니다.

void QEntity::addComponent(Qt3DCore::QComponent *comp)

컴포넌트에 대한 새 참조를 추가합니다 comp.

참고: Qt3DCore::QComponent 에 부모가 없는 경우 Qt3DCore::QEntity 이 자신을 부모로 설정하여 컴포넌트의 소유권을 가져옵니다.

Qt3DCore::QComponentVector QEntity::components() const

엔티티가 참조하고 있는 Qt3DCore::QComponent 인스턴스 목록을 반환합니다.

template <typename T> QList<T *> QEntity::componentsOfType() const

이 엔티티에 추가된 모든 컴포넌트 중 유형 T로 형변환할 수 있는 컴포넌트를 반환하거나, 해당 컴포넌트가 없는 경우 빈 벡터를 반환합니다.

Qt3DCore::QEntity *QEntity::parentEntity() const

이 엔티티의 부모 Qt3DCore::QEntity 인스턴스를 반환합니다. 직계 부모가 Qt3DCore::QEntity 이 아닌 경우 이 함수는 부모 Qt3DCore::QEntity 를 찾을 때까지 씬 계층 구조를 거슬러 올라갑니다. Qt3DCore::QEntity 부모를 찾을 수 없으면 null을 반환합니다.

void QEntity::removeComponent(Qt3DCore::QComponent *comp)

comp 에 대한 참조를 제거합니다.

관련 비회원

[alias] QComponentVector

QComponent 포인터 목록.

© 2025 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.