이 페이지에서

Qt3DRender::Quick::QScene2D Class

class Qt3DRender::Quick::QScene2D

이 클래스를 사용하면 QML을 텍스처로 렌더링할 수 있으며, 이 텍스처는 3D 씬의 일부로 활용될 수 있습니다. 더 보기...

헤더: #include <Qt3DQuickScene2D/QScene2D>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dquickscene2d)
target_link_libraries(mytarget PRIVATE Qt6::3dquickscene2d)
qmake: QT += 3dquickscene2d
QML에서: Scene2D
상속: Qt3DCore::QNode
상태: 사용 중단됨

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

공개 유형

enum RenderPolicy { Continuous, SingleShot }

속성

공개 함수

QScene2D(Qt3DCore::QNode *parent = nullptr)
void addEntity(Qt3DCore::QEntity *entity)
QList<Qt3DCore::QEntity *> entities() const
bool isMouseEnabled() const
QQuickItem *item() const
Qt3DRender::QRenderTargetOutput *output() const
void removeEntity(Qt3DCore::QEntity *entity)
Qt3DRender::Quick::QScene2D::RenderPolicy renderPolicy() const

공개 슬롯

void setItem(QQuickItem *item)
void setMouseEnabled(bool enabled)
void setOutput(Qt3DRender::QRenderTargetOutput *output)
void setRenderPolicy(Qt3DRender::Quick::QScene2D::RenderPolicy policy)

신호

void itemChanged(QQuickItem *item)
void mouseEnabledChanged(bool enabled)
void outputChanged(Qt3DRender::QRenderTargetOutput *output)
void renderPolicyChanged(Qt3DRender::Quick::QScene2D::RenderPolicy policy)

상세 설명

이 클래스는 ` QQuickRenderControl `를 사용하여 주어진 ` QQuickItem `를 오프스크린 서피스로 렌더링하며, 이 서피스는 사용자가 제공한 텍스처에 연결됩니다. 이를 통해 컴포넌트는 중간 복사 과정 없이 텍스처에 직접 렌더링할 수 있으며, 사용자는 3D 씬에서 텍스처가 사용되는 방식을 자유롭게 지정할 수 있습니다.

QScene2D를 사용하는 엔티티는 이 클래스와 연결되어 아이템과의 상호 작용을 가능하게 할 수 있습니다. 엔티티에 QObjectPicker 컴포넌트가 있는 경우, 해당 피커의 픽 이벤트가 QScene2D로 전송되어 마우스 이벤트로 변환된 후 최종적으로 아이템으로 전송됩니다.

참고: 마우스이벤트만 지원됩니다. 이 아이템은 키보드 입력을 지원하지 않습니다.

멤버 유형 문서

enum QScene2D::RenderPolicy

이 열거형 유형은 사용 가능한 렌더링 정책의 유형을 설명합니다.

상수값설명
Qt3DRender::Quick::QScene2D::Continuous0Scene2D가 지속적으로 렌더링 중입니다. 이것이 기본 렌더링 정책입니다.
Qt3DRender::Quick::QScene2D::SingleShot1Scene2D는 텍스처에 한 번만 렌더링한 후, 렌더링에 할당된 리소스를 해제합니다.

속성 설명

item : QQuickItem*

텍스처에 QScene2D 에 의해 렌더링된 ‘ QQuickItem ’를 저장합니다.

액세스 함수:

QQuickItem *item() const
void setItem(QQuickItem *item)

알림 신호:

void itemChanged(QQuickItem *item)

mouseEnabled : bool

렌더링된 항목에 대해 마우스 이벤트가 활성화되어 있는지 여부를 나타냅니다. 마우스 이벤트는 ` QScene2D`에 추가된 엔티티의 오브젝트 선택 이벤트에서 생성됩니다. 마우스는 기본적으로 활성화되어 있습니다.

참고: 오브젝트 선택이 백엔드에서 처리되기 때문에이벤트가 한 프레임 정도 지연됩니다.

액세스 함수:

bool isMouseEnabled() const
void setMouseEnabled(bool enabled)

Notifier 시그널:

void mouseEnabledChanged(bool enabled)

output : Qt3DRender::QRenderTargetOutput*

QScene2D 이 렌더링할 위치를 지정하는 QRenderTargetOutput을 보관합니다.

액세스 함수:

Qt3DRender::QRenderTargetOutput *output() const
void setOutput(Qt3DRender::QRenderTargetOutput *output)

Notifier 신호:

void outputChanged(Qt3DRender::QRenderTargetOutput *output)

renderPolicy : RenderPolicy

이 Scene2D의 렌더링 정책을 보관합니다.

액세스 함수:

Qt3DRender::Quick::QScene2D::RenderPolicy renderPolicy() const
void setRenderPolicy(Qt3DRender::Quick::QScene2D::RenderPolicy policy)

Notifier 시그널:

void renderPolicyChanged(Qt3DRender::Quick::QScene2D::RenderPolicy policy)

멤버 함수 문서

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

이 생성자는 지정된 ` parent`를 사용하여 새로운 `QScene2D` 인스턴스를 생성합니다.

void QScene2D::addEntity(Qt3DCore::QEntity *entity)

QScene2D 객체에 entity 를 추가합니다. 엔티티에 QObjectPicker가 있는 경우, 해당 엔티티의 선택 이벤트가 QScene2D 로 전송되어 마우스 이벤트로 변환됩니다.

QList<Qt3DCore::QEntity *> QScene2D::entities() const

QScene2D 와 관련된 엔티티를 가져옵니다.

void QScene2D::removeEntity(Qt3DCore::QEntity *entity)

QScene2D 객체에서 entity 을 제거합니다.

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