【发布时间】:2021-04-18 15:06:18
【问题描述】:
我使用的是 Qt 5.15.2,我有以下代码:
QByteArray arybytData = mpsckIncoming->readAll();
bool blnHTTP = false;
if ( arybytData.startsWith("GET / HTTP/") == true ) {
//HTTP Request, probably from browser, jump to end of header
const QString cstrHeaderTerminator("\r\n\r\n");
int intHdrEnd;
if ( (intHdrEnd = arybytData.indexOf(cstrHeaderTerminator)) == -1 ) {
使用QByteArray::indexOf() 的行有文字:
'indexOf' is deprecated: Use QString's toUtf8(), toLatin1() or toLocal8Bit()
我不明白这一点,因为建议的函数都不像 QByteArrray::indexOf() 的函数。
我应该忽略它吗?
我正在使用:
Qt Creator 4.14.0
Based on Qt 5.15.2 (Clang 11.0 (Apple), 64 bit)
Built on Dec 17 2020 07:57:30
From revision 909f74dc56
【问题讨论】:
标签: c++ qt qbytearray