QByteArray QByteArray::toHex() const
Returns a hex encoded copy of the byte array. The hex encoding uses the numbers 0-9 and the letters a-f.
char * QByteArray::data()
Returns a pointer to the data stored in the byte array. The pointer can be used to access and modify the bytes that compose the array. The data is '\0'-terminated, i.e. the number of bytes in the returned character string is size() + 1 for the '\0' terminator.
toHex()将QByteArray转换成16进制,data()将QByteArray转换成char*, 然后利用QString的拷贝构造函数将char*转换成QString