Obsolete Members for QByteArrayView

QByteArrayView 的以下成员已被弃用。提供这些成员是为了保持旧源代码的正常运行。我们强烈建议不要在新代码中使用它们。

公共函数

(since 6.5, deprecated) QByteArrayView left(qsizetype length) const
(since 6.5, deprecated) QByteArrayView mid(qsizetype start, qsizetype length = -1) const
(since 6.5, deprecated) QByteArrayView right(qsizetype length) const

成员函数文档

[constexpr, since 6.5, deprecated] QByteArrayView QByteArrayView::left(qsizetype length) const

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

请在新代码中使用first() 代替它。

返回本对象中从位置 0 开始的长度为length 的子数组。

如果length 大于或等于size() 或小于零,则返回整个字节数组视图。

此函数在 Qt 6.5 中引入。

另请参见 first()、last()、sliced()、startsWith()、chopped()、chop()、truncate() 和slice()。

[constexpr, since 6.5, deprecated] QByteArrayView QByteArrayView::mid(qsizetype start, qsizetype length = -1) const

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

请在新代码中使用sliced() 代替它。

返回从本对象中start 位置开始的长度为length 的子数组。

如果start 超过字节数组视图的长度,则返回空字节数组视图。如果从start 开始的字节数组视图中可用字符少于length ,或length 为负数(默认值),则该函数将返回从start 开始的所有可用字符。

此函数在 Qt 6.5 中引入。

另请参阅 first()、last()、sliced()、chopped()、chop()、truncate() 和slice()。

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

请在新代码中使用last() 代替它。

返回从size() -length 位置开始的长度为length 的子数组。

如果length 大于或等于size() 或小于零,则返回整个字节数组视图。

此函数在 Qt 6.5 中引入。

另请参见 first()、last()、sliced()、endsWith()、chopped()、chop()、truncate() 和slice()。

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