QString to Char* 转换 Posted on 2019/12/17 by LT QString str1 = "Test"; QByteArray ba = str1.toLocal8Bit(); const char * c_str2 = ba.data();