QScene2D Class
class Qt3DRender::Quick::QScene2D이 클래스를 사용하면 qml을 텍스처로 렌더링한 다음 3D 씬의 일부로 사용할 수 있습니다. 더 보기...
Header: | #include <Qt3DQuickScene2D/QScene2D> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3dquickscene2d) target_link_libraries(mytarget PRIVATE Qt6::3dquickscene2d) |
qmake: | QT += 3dquickscene2d |
QML에서: | Scene2D |
상속합니다: | Qt3DCore::QNode |
상태: | Deprecated |
공용 유형
enum | RenderPolicy { Continuous, SingleShot } |
속성
- item : QQuickItem*
- mouseEnabled : bool
- output : Qt3DRender::QRenderTargetOutput*
- renderPolicy : RenderPolicy
공용 기능
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로 전송되어 마우스 이벤트로 변환된 후 항목으로 최종 전송됩니다.
참고: 마우스 이벤트만 지원됩니다. 이 항목은 키보드 입력을 지원하지 않습니다.
프로퍼티 문서
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) |
알림 신호:
void | mouseEnabledChanged(bool enabled) |
output : Qt3DRender::QRenderTargetOutput*
QScene2D 이 렌더링되는 위치를 지정하는 QRenderTargetOutput 을 보유합니다.
액세스 함수:
Qt3DRender::QRenderTargetOutput * | output() const |
void | setOutput(Qt3DRender::QRenderTargetOutput *output) |
알림 신호:
void | outputChanged(Qt3DRender::QRenderTargetOutput *output) |
renderPolicy : RenderPolicy
의 렌더링 정책을 보유합니다 Scene2D.
액세스 함수:
Qt3DRender::Quick::QScene2D::RenderPolicy | renderPolicy() const |
void | setRenderPolicy(Qt3DRender::Quick::QScene2D::RenderPolicy policy) |
알림 신호:
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 을 제거합니다.
© 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.