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 参数的构造函数。

从包含QQmlListPropertyQVariant variant 构造一个 QQmlListReference。如果variant 不包含列表属性,则会创建一个无效的 QQmlListReference。如果在创建引用后,拥有列表属性的对象被销毁,它将自动变为无效。也就是说,即使对象被删除,持有 QQmlListReference 实例也是安全的。

engine 未被使用。

此函数在 Qt 6.1 中引入。

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

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

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

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

engine 未被使用。

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