Obsolete Members for QQmlListProperty
QQmlListProperty 类的以下成员已被废弃。提供这些成员是为了确保旧源代码能够继续运行。我们强烈建议不要在新代码中使用它们。
公共函数
(deprecated) | QQmlListProperty(QObject *object, QList<T *> &list) |
成员函数文档
[implicit, deprecated] QQmlListProperty::QQmlListProperty(QObject *object, QList<T *> &list)
此函数已弃用。我们强烈建议不要在新代码中使用它。
这是一个便捷构造函数,用于根据现有的QList list 创建QQmlListProperty值。必须提供拥有该列表的object 以及list 本身,并且在您持有引用它们的QQmlListProperty期间,必须保持它们存活。
此构造函数利用 count()、at()、clear() 和 append() 方法,合成了 Qt 5.15 中引入的 removeLast() 和 replace() 方法。该操作速度较慢。若您打算对列表进行清空以外的操作,应显式提供这些方法。
© 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.