1 QString str = QString("QString转换为char*"); 2 char *ch; 3 QByteArray ba = str.toUtf8(); 4 ch = ba.data();