1.QString to const char*
QString string;
const char* str = string.toLatin1.data();
当然也可以 const char* s = string.toStdString().c_str();
2.QByteArray to char*
QByteArray arrary;
char* ch = arrary.data();
3.QString to QByteArray
QString str;
QByteArray array = str.toUtf8();