Obsolete Members for QQmlEngine
QQmlEngine 类的以下成员已被废弃。提供这些成员是为了确保旧源代码能够继续运行。我们强烈建议不要在新代码中使用它们。
公共函数
(deprecated in 6.4) bool | importPlugin(const QString &filePath, const QString &uri, QList<QQmlError> *errors) |
(deprecated) QQmlAbstractUrlInterceptor * | urlInterceptor() const |
成员函数文档
[deprecated in 6.4] bool QQmlEngine::importPlugin(const QString &filePath, const QString &uri, QList<QQmlError> *errors)
自 6.4 版本起,该函数已被废弃。我们强烈建议不要在新代码中使用它。
请改用“import”语句从 QML 中导入该模块。
导入名为filePath 的插件,并提供uri 。如果插件成功导入,则返回 true;否则返回 false。
如果导入失败且该参数不为空,则errors 列表的开头会添加发生的任何错误。
该插件必须是实现了QQmlEngineExtensionPlugin 接口的 Qt 插件。
注意: 像这样直接 加载插件可能会干扰模块导入逻辑。若要使导入逻辑从特定位置加载插件,可以使用addPluginPath()。每个插件都应属于一个 QML 模块,您可以使用“import”语句导入该模块。
[deprecated] QQmlAbstractUrlInterceptor *QQmlEngine::urlInterceptor() const
此函数已弃用。我们强烈建议不要在新代码中使用它。
此 API 在 5.1 版本中为私有
返回最后一个QQmlAbstractUrlInterceptor 。该对象绝不能在GUI线程之外进行修改。
© 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.