Obsolete Members for QQmlListReference

QQmlListReference 类的以下成员已被废弃。提供这些成员是为了确保旧源代码能够继续运行。我们强烈建议在新代码中不要使用它们。

公共函数

(since 6.1, deprecated) QQmlListReference(const QVariant &variant, QQmlEngine *engine)
(deprecated) QQmlListReference(QObject *object, const char *property, QQmlEngine *engine)

成员函数文档

[since 6.1, deprecated] QQmlListReference::QQmlListReference(const QVariant &variant, QQmlEngine *engine)

此函数已弃用。我们强烈建议不要在新代码中使用它。

请改用不带QQmlEngine 参数的构造函数。

根据包含QQmlListProperty 的QVariant variant 构建一个QQmlListReference。如果variant 不包含列表属性,则会创建一个无效的QQmlListReference。如果拥有列表属性的对象在引用构建后被销毁,该引用将自动失效。也就是说,即使对象已被删除,保留QQmlListReference实例也是安全的。

engine 未被使用。

该函数在 Qt 6.1 中引入。

[deprecated] QQmlListReference::QQmlListReference(QObject *object, const char *property, QQmlEngine *engine)

此函数已弃用。我们强烈建议不要在新代码中使用它。

请改用不带QQmlEngine 参数的构造函数。

为object 的property 创建一个QQmlListReference。如果property 不是列表属性,则会创建一个无效的QQmlListReference。如果在引用创建后object 被销毁,该引用将自动失效。也就是说,即使在object 被删除后,保留QQmlListReference实例也是安全的。

engine 未被使用。

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