QString 转 QByteArray ?
这个QString 转 QByteArray ,网上看了些,但问题还是没解决,
假如:
QByteArray byte;
byte.append(0x68).append(0x65).append(0x6c).append(0x6c).append(0x6f);
QString::fromAscii(byte.data());
qDebug()<<byte; //结果是hello
怎样到过来转,把 hello 转成 0x68 0x65 0x6c 0x6c 0x6f,这种形式的。