QProcess* process = new QProcess();
QString lastPicPath = "C:/Users/Public/Pictures/Sample Pictures/Chrysanthemum.jpg";
//文件格式必须调整
QString sPicPath = lastPicPath.replace("/", "\");
QString program = "cmd.exe";
QStringList para;
para << "/c";
//命令间需要添加空格
para << QString("rundll32") + QString(" %Systemroot%\\System32\\shimgvw.dll,ImageView_Fullscreen ")+ sPicPath;
process->start(program, para);
参考网址:
https://blog.csdn.net/wey123456789/article/details/38852113