QByteArray
来源:互联网 发布:java 日志服务器搭建 编辑:程序博客网 时间:2024/05/23 01:56
Qt助手上有这样一段代码
int QByteArray::size() const
Returns the number of bytes in this byte array.
The last byte in the byte array is at position size() - 1. In addition, QByteArray ensures that the byte at position size() is always '\0', so that you can use the return value of data() and constData() as arguments to functions that expect '\0'-terminated strings. If the QByteArray object was created from a raw data that didn't include the trailing null-termination character then QByteArray doesn't add it automaticall unless the deep copy is created.
Example:
QByteArray ba("Hello");
int n = ba.size(); // n == 5
ba.data()[0]; // returns 'H'
ba.data()[4]; // returns 'o'
ba.data()[5]; // returns '\0'
See also isEmpty() and resize().
int QByteArray::size() const
Returns the number of bytes in this byte array.
The last byte in the byte array is at position size() - 1. In addition, QByteArray ensures that the byte at position size() is always '\0', so that you can use the return value of data() and constData() as arguments to functions that expect '\0'-terminated strings. If the QByteArray object was created from a raw data that didn't include the trailing null-termination character then QByteArray doesn't add it automaticall unless the deep copy is created.
Example:
QByteArray ba("Hello");
int n = ba.size(); // n == 5
ba.data()[0]; // returns 'H'
ba.data()[4]; // returns 'o'
ba.data()[5]; // returns '\0'
See also isEmpty() and resize().
QList<QByteArray> QByteArray::s
QByteArray qbaData = "11111111111111111111100100010111111111111111111111";
QString qstrTemp = QString(qbaData);
阅读全文
0 0
- QByteArray
- QByteArray
- QString QbyteArray
- QByteArray类
- QT:QByteArray和QByteArray、char *
- Qt5 QByteArray to QString & QString to QByteArray
- QByteArray显示中文
- QString Char* QByteArray转换
- QString Char* QByteArray转换
- QByteArray和 QVariant--51
- QByteArray和QVariant
- QByteArray和QVariant(ZZ)
- QByteArray转向QString
- Qt入门-QByteArray类
- 关于字节数组QByteArray
- QImage - QByteArray - QString
- QString, QByteArray,和 QVariant
- Qstring ,char*,QByteArray转换
- HDU 6048 思维+找规律
- java类加载器 -- 双亲委托机制
- Find MaxXorSum NBUT
- 洛谷3366 最小生成树(Prim + 堆优化)
- TreeControl控件的使用(一)
- QByteArray
- C语言实现C++的继承和多态
- F
- 新手看Java中的多态
- 原创:用python把链接指向的网页直接生成图片的http服务及网站(含源码及思想)
- 【补充】uboot makefile 中的unconfig
- 古文觀止卷七_龍說/馬說_韓愈
- I/O栈链路优化
- ubuntu下 tftp服务器的搭建