1.头文件加上 #include <QTextCodec>
2.QString 获取拖拽或file对话框信息
3.先转为std::string ,然后由string 转为QString
QTextCodec *code = QTextCodec::codecForName("GB2312");// fix Chinese name;
std::string std_filename = code->fromUnicode(QfileName).data();
QString fileName =QString::fromLocal8Bit(std_filename.c_str());
4.后续再调用
来源:CSDN
作者:谢娘蓝桥
链接:https://blog.csdn.net/xinshuwei/article/details/104537822