Obsolete Members for QQmlListProperty
类QQmlListProperty 的以下成员已被弃用。提供这些成员是为了保持旧源代码的正常运行。我们强烈建议不要在新代码中使用它们。
公共函数
(deprecated) | QQmlListProperty(QObject *object, QList<T *> &list) |
成员函数文档
[default, deprecated]
QQmlListProperty::QQmlListProperty(QObject *object, QList<T *> &list)
该函数已被弃用。我们强烈建议不要在新代码中使用它。
方便构造函数,用于从现有的QList list 中生成一个 QQmlListProperty 值。只要您持有指向它们的 QQmlListProperty,就必须提供拥有该列表的object 和list 本身并保持其活力。
该构造函数使用 count()、at()、clear() 和 append(),合成了 Qt 5.15 中引入的 removeLast() 和 replace() 方法。这种方法速度很慢。如果您除了清空列表外还想对其进行其他操作,则应明确提供这些方法。
© 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.