Obsolete Members for QVarLengthArray
QVarLengthArray 类的以下成员已被废弃。提供这些成员是为了确保旧源代码能够继续运行。我们强烈建议在新代码中不要使用它们。
公共函数
成员函数文档
[deprecated in 6.3] void QVarLengthArray::prepend(T &&value)
[deprecated in 6.3] void QVarLengthArray::prepend(const T &value)
自 6.3 版本起,此函数已被废弃。我们强烈建议不要在新代码中使用它。
该函数运行较慢。如果必须使用,请改用insert(cbegin(), ~~~) 。
将 `value ` 插入数组开头。
这与 vector.insert(0,value) 效果相同。
对于大型数组,此操作可能很慢(线性时间),因为它需要将向量中的所有元素在内存中向后移动一个位置。如果您需要一个提供快速 `prepend()` 函数的容器类,请改用 `std::list`。
© 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.