이 페이지에서

Qt3DCore::QEntity Class

class Qt3DCore::QEntity

Qt3DCore::QEntity Qt3DCore::QNode 의 하위 클래스로, 이 클래스의 동작을 정의하는 여러 인스턴스를 통합할 수 있습니다. Qt3DCore::QComponent 더 보기...

헤더: #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

상태: 사용 중단됨

이 클래스는 더 이상 사용되지 않습니다. 새로운 코드에서는 이 클래스를 사용하지 않는 것을 강력히 권장합니다.

공개 함수

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::QComponent 및 Qt3DCore::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 포인터 목록.

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