本页内容

Qt3DCore::Quick::QQmlAspectEngine Class

class Qt3DCore::Quick::QQmlAspectEngine

QQmlAspectEngine 为QAspectEngine 提供了一个运行环境,并提供了一种实例化 QML 组件的方法。更多内容...

标题: #include <Qt3DQuick/QQmlAspectEngine>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3DCore)
target_link_libraries(mytarget PRIVATE Qt6::3DCore)
qmake: QT += 3dcore
继承自: QObject
状态: 已弃用

该类已被弃用。我们强烈建议不要在新代码中使用它。

公共类型

enum Status { Null, Ready, Loading, Error }

公共函数

QQmlAspectEngine(QObject *parent = nullptr)
Qt3DCore::QAspectEngine *aspectEngine() const
QQmlEngine *qmlEngine() const
void setSource(const QUrl &source)
Qt3DCore::Quick::QQmlAspectEngine::Status status() const

信号

void sceneCreated(QObject *rootObject)
void statusChanged(Qt3DCore::Quick::QQmlAspectEngine::Status status)

详细说明

成员类型文档

enum QQmlAspectEngine::Status

发动机的状态。

常量值
Qt3DCore::Quick::QQmlAspectEngine::Null0
Qt3DCore::Quick::QQmlAspectEngine::Ready1
Qt3DCore::Quick::QQmlAspectEngine::Loading2
Qt3DCore::Quick::QQmlAspectEngine::Error3

成员函数文档

[explicit] QQmlAspectEngine::QQmlAspectEngine(QObject *parent = nullptr)

使用parent 构建一个新的QQmlAspectEngine。

Qt3DCore::QAspectEngine *QQmlAspectEngine::aspectEngine() const

返回 aspectEngine。

QQmlEngine *QQmlAspectEngine::qmlEngine() const

返回引擎。

[signal] void QQmlAspectEngine::sceneCreated(QObject *rootObject)

当场景被实例化时,会通过rootObject 事件触发此信号。这为在将场景传递给方面引擎之前对其进行操作提供了机会。对于便利窗口类而言,这非常有用,可用于在帧图上设置摄像机和表面,以及为输入方面等设置事件源。

void QQmlAspectEngine::setSource(const QUrl &source)

将 `source ` 设置为待创建的 QML 组件的源文件。

Qt3DCore::Quick::QQmlAspectEngine::Status QQmlAspectEngine::status() const

返回状态。

[signal] void QQmlAspectEngine::statusChanged(Qt3DCore::Quick::QQmlAspectEngine::Status status)

当发动机状态发生变化时,会通过status 发出此信号。

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